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

Commit f7e31e6d authored by Patrick Baumann's avatar Patrick Baumann
Browse files

Fixes incorrect system app deletion logic

This change corrects a bad boolean check made in a recent refactor that
was causing non-child system packages to be treated as system packages.
It also bypasses the may delete check for replacing system apps as these
are not deleted the same as non-system.

Change-Id: If43a6d019deb0f203a5cfd2c33e02679b05899f3
Fixes: 120213570
Fixes: 120186133
Test: system updates are successful
parent 8dac427f
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -15246,7 +15246,8 @@ public class PackageManagerService extends IPackageManager.Stub
                        "inputs not balanced; missing argument for " + installPackageName);
            }
            final DeletePackageAction deletePackageAction;
            if (prepareResult.replace) {
            // we only want to try to delete for non system apps
            if (prepareResult.replace && !prepareResult.system) {
                deletePackageAction = mayDeletePackageLocked(res.removedInfo,
                        prepareResult.originalPs, prepareResult.disabledPs,
                        prepareResult.childPackageSettings);
@@ -17818,7 +17819,7 @@ public class PackageManagerService extends IPackageManager.Stub
            return null;
        }
        if (isSystemApp(ps)) {
            if (ps.parentPackageName == null) {
            if (ps.parentPackageName != null) {
                Slog.w(TAG, "Attempt to delete child system package " + ps.pkg.packageName);
                return null;
            }