Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit fab272e0 authored by Jeff Sharkey's avatar Jeff Sharkey Committed by android-build-merger
Browse files

Merge "Build browse intents based on target user." into pi-dev

am: c49d44c3

Change-Id: I3e7bd4bc41115c42687be3be7c5a03e0919dfaf1
parents 8fa6942f c49d44c3
Loading
Loading
Loading
Loading
+5 −1
Original line number Original line Diff line number Diff line
@@ -407,8 +407,12 @@ public class VolumeInfo implements Parcelable {
     * {@link #TYPE_EMULATED} or {@link #TYPE_PUBLIC}.
     * {@link #TYPE_EMULATED} or {@link #TYPE_PUBLIC}.
     */
     */
    public @Nullable Intent buildBrowseIntent() {
    public @Nullable Intent buildBrowseIntent() {
        return buildBrowseIntentForUser(UserHandle.myUserId());
    }

    public @Nullable Intent buildBrowseIntentForUser(int userId) {
        final Uri uri;
        final Uri uri;
        if (type == VolumeInfo.TYPE_PUBLIC && mountUserId == UserHandle.myUserId()) {
        if (type == VolumeInfo.TYPE_PUBLIC && mountUserId == userId) {
            uri = DocumentsContract.buildRootUri(DOCUMENT_AUTHORITY, fsUuid);
            uri = DocumentsContract.buildRootUri(DOCUMENT_AUTHORITY, fsUuid);
        } else if (type == VolumeInfo.TYPE_EMULATED && isPrimary()) {
        } else if (type == VolumeInfo.TYPE_EMULATED && isPrimary()) {
            uri = DocumentsContract.buildRootUri(DOCUMENT_AUTHORITY,
            uri = DocumentsContract.buildRootUri(DOCUMENT_AUTHORITY,
+1 −1
Original line number Original line Diff line number Diff line
@@ -640,7 +640,7 @@ public class StorageNotification extends SystemUI {
    }
    }


    private PendingIntent buildBrowsePendingIntent(VolumeInfo vol) {
    private PendingIntent buildBrowsePendingIntent(VolumeInfo vol) {
        final Intent intent = vol.buildBrowseIntent();
        final Intent intent = vol.buildBrowseIntentForUser(vol.getMountUserId());


        final int requestKey = vol.getId().hashCode();
        final int requestKey = vol.getId().hashCode();
        return PendingIntent.getActivityAsUser(mContext, requestKey, intent,
        return PendingIntent.getActivityAsUser(mContext, requestKey, intent,