Merge "Fix bug in getStorageVolumesIncludingSharedProfiles" into tm-dev am: 7f24e585e2

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

Change-Id: I2e14861a77f8da89b83f3da50b562a3e364fccb9
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
Saumya Pathak
2022-05-11 20:35:21 +00:00
committed by Automerger Merge Worker

View File

@@ -3880,9 +3880,12 @@ class StorageManagerService extends IStorageManager.Stub
match = vol.isVisibleForWrite(userId) match = vol.isVisibleForWrite(userId)
|| (includeSharedProfile && vol.isVisibleForWrite(userIdSharingMedia)); || (includeSharedProfile && vol.isVisibleForWrite(userIdSharingMedia));
} else { } else {
// 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
match = vol.isVisibleForUser(userId) match = vol.isVisibleForUser(userId)
|| (!vol.isVisible() && includeInvisible && vol.getPath() != null) || (!vol.isVisible() && includeInvisible && vol.getPath() != null)
|| (includeSharedProfile && vol.isVisibleForRead(userIdSharingMedia)); || (includeSharedProfile && vol.isVisibleForUser(userIdSharingMedia));
} }
if (!match) continue; if (!match) continue;