summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Jeff Sharkey <jsharkey@google.com> 2018-05-22 20:43:27 +0000
committer Android (Google) Code Review <android-gerrit@google.com> 2018-05-22 20:43:27 +0000
commitc49d44c3ef18f74e67fd28978b391117ee0894cc (patch)
tree6899ebc266db9522adea5da867e68c3cca1fd338
parentfe1b1f19febf8e093be693fb1548557c9ccbc245 (diff)
parentb4ee5d7b42918e9ad2bf23ecf4bb6c2200f24ae3 (diff)
Merge "Build browse intents based on target user." into pi-dev
-rw-r--r--core/java/android/os/storage/VolumeInfo.java6
-rw-r--r--packages/SystemUI/src/com/android/systemui/usb/StorageNotification.java2
2 files changed, 6 insertions, 2 deletions
diff --git a/core/java/android/os/storage/VolumeInfo.java b/core/java/android/os/storage/VolumeInfo.java
index 576ea5263280..8d4c3c3d3e68 100644
--- a/core/java/android/os/storage/VolumeInfo.java
+++ b/core/java/android/os/storage/VolumeInfo.java
@@ -407,8 +407,12 @@ public class VolumeInfo implements Parcelable {
* {@link #TYPE_EMULATED} or {@link #TYPE_PUBLIC}.
*/
public @Nullable Intent buildBrowseIntent() {
+ return buildBrowseIntentForUser(UserHandle.myUserId());
+ }
+
+ public @Nullable Intent buildBrowseIntentForUser(int userId) {
final Uri uri;
- if (type == VolumeInfo.TYPE_PUBLIC && mountUserId == UserHandle.myUserId()) {
+ if (type == VolumeInfo.TYPE_PUBLIC && mountUserId == userId) {
uri = DocumentsContract.buildRootUri(DOCUMENT_AUTHORITY, fsUuid);
} else if (type == VolumeInfo.TYPE_EMULATED && isPrimary()) {
uri = DocumentsContract.buildRootUri(DOCUMENT_AUTHORITY,
diff --git a/packages/SystemUI/src/com/android/systemui/usb/StorageNotification.java b/packages/SystemUI/src/com/android/systemui/usb/StorageNotification.java
index d52746599aa1..2f8dfdc2991a 100644
--- a/packages/SystemUI/src/com/android/systemui/usb/StorageNotification.java
+++ b/packages/SystemUI/src/com/android/systemui/usb/StorageNotification.java
@@ -640,7 +640,7 @@ public class StorageNotification extends SystemUI {
}
private PendingIntent buildBrowsePendingIntent(VolumeInfo vol) {
- final Intent intent = vol.buildBrowseIntent();
+ final Intent intent = vol.buildBrowseIntentForUser(vol.getMountUserId());
final int requestKey = vol.getId().hashCode();
return PendingIntent.getActivityAsUser(mContext, requestKey, intent,