summaryrefslogtreecommitdiff
path: root/cmds/bootanimation/BootAnimation.cpp
diff options
context:
space:
mode:
author Arnab Sen <arnabse@amazon.com> 2022-03-19 23:56:02 +0530
committer Arnab Sen <arnabse@amazon.com> 2023-08-22 11:44:26 +0530
commit04110a391188e767551a51934ce6c4a6ce616f0a (patch)
tree8e3e21acb5b60704770e27dbd7724b285ca334e6 /cmds/bootanimation/BootAnimation.cpp
parente1ee1aab9f99d05ca97dee3701afb894a6129446 (diff)
SM: Remount emulated volumes on Move Storage
Whenever move storage is executed for moving media to adopted storage from internal storage and vice-versa, the emulated volumes that are mounted for non-current users which are currently running in the system points to the physical storage for the older storage location rather than the current one. This would case data to be still stored in the older storage location rather than the current one. This would cause media content not to be accessible to the user. Android maintains separate emulated volumes for each user for internal storage as well as adopted storage. Adopted Storage has a global private volumes on which emulated volumes are created. Whenever a move is triggered the primary storage changes globally for the StorageManagerService, but the emulated volumes are not mounted correctly for the non-current users which are running in the system. To solve this added a new method remountForRunningUsersOnMove() which would inform vold and storaged that the non-current user has stopped, which is similar to onCleanupUser(int) which would remove the current emulated volume for the user and then inform vold and storgaed that user has started which would correctly mount the emulated volume for the user which is same as resetIfBootedAndConnected(). This ensures that the emulated volumes for the correct primary storage location are mounted for all the users currently running. Test: manual Perform the following steps: 1. Setup the device with at least one secondary user. 2. Switch to the secondary user and switch back to current user. 3. Insert a SD Card and setup as Adopted 4. Complete the Move content flow. 5. Check the correct volumes are mounted by executing: 'adb shell dumpsys mount' and check the internal path for the mounted emulated volumes point to adopted storage. 6. Go to Settings > Storage > 'Move Data to internal storage'. 7. Check the correct volumes are mounted by executing: 'adb shell dumpsys mount' and check the internal path for the mounted emulated volumes point to internal storage. Change-Id: Ibbc4b109ff44f0f68a05da5632a4304e8b4992ac
Diffstat (limited to 'cmds/bootanimation/BootAnimation.cpp')
0 files changed, 0 insertions, 0 deletions