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

Commit 389b8f34 authored by Jeff Sharkey's avatar Jeff Sharkey Committed by android-build-merger
Browse files

Merge "Don\'t kill apps when only clearing caches." into nyc-dev

am: fc5f9f51

* commit 'fc5f9f51':
  Don't kill apps when only clearing caches.

Change-Id: I96f619bb28b21a96e0e9c3a6b69829bc2a6d9134
parents dea620e4 fc5f9f51
Loading
Loading
Loading
Loading
+9 −10
Original line number Original line Diff line number Diff line
@@ -16063,16 +16063,15 @@ public class PackageManagerService extends IPackageManager.Stub {
        // Queue up an async operation since the package deletion may take a little while.
        // Queue up an async operation since the package deletion may take a little while.
        mHandler.post(new Runnable() {
        mHandler.post(new Runnable() {
            public void run() {
            public void run() {
                try (PackageFreezer freezer = freezePackage(packageName,
                        "deleteApplicationCacheFiles")) {
                synchronized (mInstallLock) {
                synchronized (mInstallLock) {
                    final int flags = StorageManager.FLAG_STORAGE_DE
                    final int flags = StorageManager.FLAG_STORAGE_DE
                            | StorageManager.FLAG_STORAGE_CE;
                            | StorageManager.FLAG_STORAGE_CE;
                    // We're only clearing cache files, so we don't care if the
                    // app is unfrozen and still able to run
                    clearAppDataLIF(pkg, userId, flags | Installer.FLAG_CLEAR_CACHE_ONLY);
                    clearAppDataLIF(pkg, userId, flags | Installer.FLAG_CLEAR_CACHE_ONLY);
                    clearAppDataLIF(pkg, userId, flags | Installer.FLAG_CLEAR_CODE_CACHE_ONLY);
                    clearAppDataLIF(pkg, userId, flags | Installer.FLAG_CLEAR_CODE_CACHE_ONLY);
                }
                }
                clearExternalStorageDataSync(packageName, userId, false);
                clearExternalStorageDataSync(packageName, userId, false);
                }
                if (observer != null) {
                if (observer != null) {
                    try {
                    try {
                        observer.onRemoveCompleted(packageName, true);
                        observer.onRemoveCompleted(packageName, true);