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

Commit 0f6a5507 authored by Alan Stokes's avatar Alan Stokes
Browse files

Don't destroy ART profiles after package move.

They don't get moved, so instead of deleting a redundant copy we are
deleting the only copy.

Bug: 149200535
Test: Manual. After repro steps in bug app is moved, profiles are not
deleted.

Change-Id: Id6af14ca4611a668135330565fce976cab7610ef
parent c0570cf0
Loading
Loading
Loading
Loading
+5 −2
Original line number Diff line number Diff line
@@ -15206,10 +15206,13 @@ public class PackageManagerService extends IPackageManager.Stub
                // We purposefully exclude FLAG_STORAGE_EXTERNAL here, since
                // this task was only focused on moving data on internal storage.
                // We don't want ART profiles cleared, because they don't move,
                // so we would be deleting the only copy (b/149200535).
                final int flags = FLAG_STORAGE_DE | FLAG_STORAGE_CE
                        | Installer.FLAG_CLEAR_APP_DATA_KEEP_ART_PROFILES;
                for (int userId : userIds) {
                    try {
                        mInstaller.destroyAppData(volumeUuid, move.packageName, userId,
                                StorageManager.FLAG_STORAGE_DE | StorageManager.FLAG_STORAGE_CE, 0);
                        mInstaller.destroyAppData(volumeUuid, move.packageName, userId, flags, 0);
                    } catch (InstallerException e) {
                        Slog.w(TAG, String.valueOf(e));
                    }