Merge "Fix getStorageVolumes to return public volumes visible to userIdSharingMedia with." am: e6454053ce

Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/2423165

Change-Id: I3a38091d88c863f7664e287d4e719c6afa5af603
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
Himanshu Gupta
2023-02-08 11:19:07 +00:00
committed by Automerger Merge Worker

View File

@@ -3851,8 +3851,12 @@ class StorageManagerService extends IStorageManager.Stub
// Return both read only and write only volumes. When includeSharedProfile is
// true, all the volumes of userIdSharingMedia should be returned when queried
// from the user it shares media with
// Public Volumes will be also be returned if visible to the
// userIdSharingMedia with.
match = vol.isVisibleForUser(userId)
|| (!vol.isVisible() && includeInvisible && vol.getPath() != null)
|| (vol.getType() == VolumeInfo.TYPE_PUBLIC
&& vol.isVisibleForUser(userIdSharingMedia))
|| (includeSharedProfile && vol.isVisibleForUser(userIdSharingMedia));
}
if (!match) continue;