Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f5206149 authored by ot_zhilin.gao@mediatek.com's avatar ot_zhilin.gao@mediatek.com Committed by Android Build Coastguard Worker
Browse files

StorageManagerService: Call invalidateVolumeListCache upon complete user unlock

When a user is completely unlocked, the invalidateVolumeListCache
function of StorageManager should be called to ensure that the
app can obtain the latest volume information.

Currently, StorageManager uses a caching structure to store volume
information obtained via the getVolumeList function of StorageManagerService.
When an app, which is started by receiving the BOOT_COMPLETED broadcast,
calls StorageManager's invalidateVolumeListCache function, an issue may arise.

If the data/media partition has already been mounted but the user has not yet
unlocked it, the volume information returned by StorageManagerService's
getVolumeList will have a state of "unmounted". This volume information will
be cached in StorageManager's sVolumeListCache. Since the mVolumes information
in StorageManagerService has not changed, the cache will not trigger a refresh.

Consequently, the app will always retrieve volume information with an "unmounted"
state from the cache when calling StorageManager's getVolumeList function.

Bug: 407690018
Flag: EXEMPT bug fix
Test:m
1. Start the app by receiving the BOOT_COMPLETED broadcast.
2. The app calls StorageManager's getVolumeList function.
3. Call the getState function to check the mount status of the StorageVolume.
(cherry picked from https://android-review.googlesource.com/q/commit:f2a5bd48dcdd999284cf8fb99d2f866566bdb013)
(cherry picked from https://googleplex-android-review.googlesource.com/q/commit:686d0259f41a835fa60c9dbc5e797e5379119c7a)
Merged-In: Ib1b86c604f9e9f0dd413673ed6e767103d887b32
Change-Id: Ib1b86c604f9e9f0dd413673ed6e767103d887b32
parent e4397b9b
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment