Fix getStorageVolumes to return only storage volumes available to the calling user
Before this change, it also returns volumes (SDCards) that are mounted on a different user. Bug: b/196928102 Test: atest StorageManagerTest Test: atest StorageManagerCrossProfileUSBTest Test: atest StorageManagerCrossProfileSDCardTest Change-Id: I2bcece22a67a1b06281ec73608d83a31b315b8c8
This commit is contained in:
@@ -4072,7 +4072,7 @@ class StorageManagerService extends IStorageManager.Stub
|
||||
|| (includeSharedProfile && vol.isVisibleForWrite(userIdSharingMedia));
|
||||
} else {
|
||||
match = vol.isVisibleForUser(userId)
|
||||
|| (includeInvisible && vol.getPath() != null)
|
||||
|| (!vol.isVisible() && includeInvisible && vol.getPath() != null)
|
||||
|| (includeSharedProfile && vol.isVisibleForRead(userIdSharingMedia));
|
||||
}
|
||||
if (!match) continue;
|
||||
|
||||
Reference in New Issue
Block a user