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

Commit 0000d8ae authored by Jeff Sharkey's avatar Jeff Sharkey
Browse files

Public volumes only browsable by mounting user.

We can't browse public volumes mounted for a different user, so don't
return an Intent claiming that we can, since it'll just fail.

Test: manual
Bug: 74056525
Change-Id: Iba4e52c2672258b981d2912875e55949bb35e310
parent d1257462
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -402,9 +402,9 @@ public class VolumeInfo implements Parcelable {
     * Build an intent to browse the contents of this volume. Only valid for
     * {@link #TYPE_EMULATED} or {@link #TYPE_PUBLIC}.
     */
    public Intent buildBrowseIntent() {
    public @Nullable Intent buildBrowseIntent() {
        final Uri uri;
        if (type == VolumeInfo.TYPE_PUBLIC) {
        if (type == VolumeInfo.TYPE_PUBLIC && mountUserId == UserHandle.myUserId()) {
            uri = DocumentsContract.buildRootUri(DOCUMENT_AUTHORITY, fsUuid);
        } else if (type == VolumeInfo.TYPE_EMULATED && isPrimary()) {
            uri = DocumentsContract.buildRootUri(DOCUMENT_AUTHORITY,