Fixing Storage Volume listing for Cloned User.
Current implementation only returns the Volumes for the current user. In case of Cloned user this causes issues as Cloned user uses Media Provider of User 0, thereby returning only Volume 0, causing problems in assigning projectIds, and affecting storage calculation. The projectId assignement happens via MediaProvider.updateExternalStorageFileQuota. Bug: 235321217 Test: atest android.appsecurity.cts.StorageHostTest Change-Id: I617bae9b201fd66d7b62b6cbd1c48b9f276f1924 Fixing Storage Volume(s) Retrieval. With ag/19901205 shared_profile's volumes were also listed in StorageManager#updateExternalStorageFileQuotaType. However, the above API can be called from MediaProvider process, without MANAGE_EXTERNAL_STORAGE permissions, resulting in SecurityException("Only File Manager Apps permitted") to be thrown from StorageManagerService#getVolumeList This fix allows the exception to be bypassed in case the caller is Media Store process. Bug: 235321217 Test: atest android.appsecurity.cts.StorageHostTest Change-Id: I6835cc4d29f3e9c85731979aaf9ab12a30f6419b Downgrading API permissions for updateExternalStorage With ag/19901205 the permissions for this API were increased, and calling users required 'MANAGE_EXTERNAL_STORAGE' permissions. There is now a way to add the same functionality without adding any additional permissions. Bug: 235321217 Test: atest android.appsecurity.cts.StorageHostTest Change-Id: I6b166ac191a80c600b527266f53107b8d9c78177 Merged-In: I6b166ac191a80c600b527266f53107b8d9c78177 Change-Id: I475d0782cab9fa1033e16d2b4dc297b00296783b
Loading
Please register or sign in to comment