Skip to content
Commit f9c27b35 authored by Himanshu Gupta's avatar Himanshu Gupta
Browse files

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
parent 4d3ec5c8
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment