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

Commit 426e4206 authored by Jeff Sharkey's avatar Jeff Sharkey
Browse files

Iterate through all known users after moving.

installd no longer supports USER_ALL when destroying app data.

Bug: 28174913
Change-Id: I23496eda7269ad1ad58007de0f44cb89a2291ecb
parent fcf1e558
Loading
Loading
Loading
Loading
+8 −5
Original line number Diff line number Diff line
@@ -13384,15 +13384,18 @@ 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
                for (int userId : userIds) {
                    try {
                    mInstaller.destroyAppData(volumeUuid, move.packageName, UserHandle.USER_ALL,
                        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);
            }
            return true;