diff options
| author | 2020-08-17 08:39:13 +0000 | |
|---|---|---|
| committer | 2020-08-17 08:39:13 +0000 | |
| commit | 447bf08fa111570d82f188fedc025ccdcc618f37 (patch) | |
| tree | f3ce7b387db8224608f1beab2c256938e95ccb43 | |
| parent | cc2d6da3406d621808d236feb6b252208d87e4b5 (diff) | |
| parent | 97618f12d79ea2931cb095c4c54094866909fccc (diff) | |
Merge "Ensure obb migration finish before mounting obb for app data isolation"
| -rw-r--r-- | services/core/java/com/android/server/StorageManagerService.java | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/services/core/java/com/android/server/StorageManagerService.java b/services/core/java/com/android/server/StorageManagerService.java index d1d9c0e3a285..b72985cc8f2c 100644 --- a/services/core/java/com/android/server/StorageManagerService.java +++ b/services/core/java/com/android/server/StorageManagerService.java @@ -1141,13 +1141,6 @@ class StorageManagerService extends IStorageManager.Stub } private void completeUnlockUser(int userId) { - // If user 0 has completed unlock, perform a one-time migration of legacy obb data - // to its new location. This may take time depending on the size of the data to be copied - // so it's done on the StorageManager handler thread. - if (userId == 0) { - mPmInternal.migrateLegacyObbData(); - } - onKeyguardStateChanged(false); // Record user as started so newly mounted volumes kick off events @@ -1540,9 +1533,21 @@ class StorageManagerService extends IStorageManager.Stub mFuseMountedUser.remove(vol.getMountUserId()); } else if (mVoldAppDataIsolationEnabled){ final int userId = vol.getMountUserId(); - mFuseMountedUser.add(userId); // Async remount app storage so it won't block the main thread. new Thread(() -> { + + // If user 0 has completed unlock, perform a one-time migration of legacy + // obb data to its new location. This may take time depending on the size of + // the data to be copied so it's done on the StorageManager worker thread. + // This needs to be finished before start mounting obb directories. + if (userId == 0) { + mPmInternal.migrateLegacyObbData(); + } + + // Add fuse mounted user after migration to prevent ProcessList tries to + // create obb directory before migration is done. + mFuseMountedUser.add(userId); + Map<Integer, String> pidPkgMap = null; // getProcessesWithPendingBindMounts() could fail when a new app process is // starting and it's not planning to mount storage dirs in zygote, but it's |