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

Commit d1257462 authored by Jeff Sharkey's avatar Jeff Sharkey
Browse files

Public volumes are only visible to mounted user.

New lower-level security fixes are blocking access, so make these
upper-level APIs reflect those properties.

Test: manual
Bug: 68857050
Change-Id: I81160755180f4f419d8577ea1f18a6ece10c560c
parent b133cbfd
Loading
Loading
Loading
Loading
+8 −15
Original line number Diff line number Diff line
@@ -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 {
@@ -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() {