Loading core/java/android/os/storage/VolumeInfo.java +10 −17 Original line number Diff line number Diff line Loading @@ -269,14 +269,9 @@ public class VolumeInfo implements Parcelable { return (mountFlags & MOUNT_FLAG_VISIBLE) != 0; } public boolean isVisibleForRead(int userId) { if (type == TYPE_PUBLIC) { if (isPrimary() && mountUserId != userId) { // Primary physical is only visible to single user return false; } else { public boolean isVisibleForUser(int userId) { if (type == TYPE_PUBLIC && mountUserId == userId) { return isVisible(); } } else if (type == TYPE_EMULATED) { return isVisible(); } else { Loading @@ -284,14 +279,12 @@ public class VolumeInfo implements Parcelable { } } public boolean isVisibleForWrite(int userId) { if (type == TYPE_PUBLIC && mountUserId == userId) { return isVisible(); } else if (type == TYPE_EMULATED) { return isVisible(); } else { return false; public boolean isVisibleForRead(int userId) { return isVisibleForUser(userId); } public boolean isVisibleForWrite(int userId) { return isVisibleForUser(userId); } public File getPath() { Loading Loading @@ -409,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, Loading Loading
core/java/android/os/storage/VolumeInfo.java +10 −17 Original line number Diff line number Diff line Loading @@ -269,14 +269,9 @@ public class VolumeInfo implements Parcelable { return (mountFlags & MOUNT_FLAG_VISIBLE) != 0; } public boolean isVisibleForRead(int userId) { if (type == TYPE_PUBLIC) { if (isPrimary() && mountUserId != userId) { // Primary physical is only visible to single user return false; } else { public boolean isVisibleForUser(int userId) { if (type == TYPE_PUBLIC && mountUserId == userId) { return isVisible(); } } else if (type == TYPE_EMULATED) { return isVisible(); } else { Loading @@ -284,14 +279,12 @@ public class VolumeInfo implements Parcelable { } } public boolean isVisibleForWrite(int userId) { if (type == TYPE_PUBLIC && mountUserId == userId) { return isVisible(); } else if (type == TYPE_EMULATED) { return isVisible(); } else { return false; public boolean isVisibleForRead(int userId) { return isVisibleForUser(userId); } public boolean isVisibleForWrite(int userId) { return isVisibleForUser(userId); } public File getPath() { Loading Loading @@ -409,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, Loading