Iterate through all known users after moving.

installd no longer supports USER_ALL when destroying app data.

Bug: 28174913
Change-Id: I23496eda7269ad1ad58007de0f44cb89a2291ecb
This commit is contained in:
Jeff Sharkey
2016-04-15 14:51:05 -06:00
parent fcf1e55821
commit 426e4206f9

View File

@@ -13384,14 +13384,17 @@ public class PackageManagerService extends IPackageManager.Stub {
final File codeFile = new File(Environment.getDataAppDirectory(volumeUuid),
move.dataAppName);
Slog.d(TAG, "Cleaning up " + move.packageName + " on " + volumeUuid);
final int[] userIds = sUserManager.getUserIds();
synchronized (mInstallLock) {
// Clean up both app data and code
// All package moves are frozen until finished
try {
mInstaller.destroyAppData(volumeUuid, move.packageName, UserHandle.USER_ALL,
StorageManager.FLAG_STORAGE_DE | StorageManager.FLAG_STORAGE_CE, 0);
} catch (InstallerException e) {
Slog.w(TAG, String.valueOf(e));
for (int userId : userIds) {
try {
mInstaller.destroyAppData(volumeUuid, move.packageName, userId,
StorageManager.FLAG_STORAGE_DE | StorageManager.FLAG_STORAGE_CE, 0);
} catch (InstallerException e) {
Slog.w(TAG, String.valueOf(e));
}
}
removeCodePathLI(codeFile);
}