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

Commit 11ee5468 authored by Victor Hsieh's avatar Victor Hsieh
Browse files

Remove package code path for all parsing failure

Instead of only remove for INSTALL_FAILED_INVALID_APK reason, remove if
it is not a success.

This was introduced at 679bba33 in 2010.

Test: adb shell stop, tamper with an apk in /data, start
      # see bad apk being removed
Bug: 30972906
Change-Id: I8b468958a7547ce2ed030e78356b2ce3ddd3641d
parent a8cf4df4
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -8429,7 +8429,7 @@ public class PackageManagerService extends IPackageManager.Stub
                // Delete invalid userdata apps
                if ((scanFlags & SCAN_AS_SYSTEM) == 0 &&
                        errorCode == PackageManager.INSTALL_FAILED_INVALID_APK) {
                        errorCode != PackageManager.INSTALL_SUCCEEDED) {
                    logCriticalInfo(Log.WARN,
                            "Deleting invalid package at " + parseResult.scanFile);
                    removeCodePathLI(parseResult.scanFile);