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

Commit 2c0a05d0 authored by Patrick Baumann's avatar Patrick Baumann Committed by Vasyl Gello
Browse files

Handles null outInfo in deleteSystemPackageLI

This change adds null checks before accessing outInfo in
deleteSystemPackageLI.

Bug: 142083996
Bug: 141413692
Test: manual; remove static dependency on eng build and reboot
Change-Id: If0fd48343e89cbb77ccd25826656194195d5b0cd
(cherry picked from commit 17471016)
Merged-In: If0fd48343e89cbb77ccd25826656194195d5b0cd
(cherry picked from commit 6afabce5)
parent caf3c621
Loading
Loading
Loading
Loading
+18 −15
Original line number Diff line number Diff line
@@ -16215,7 +16215,8 @@ public class PackageManagerService extends IPackageManager.Stub {
     * Tries to delete system package.
     */
    private boolean deleteSystemPackageLIF(PackageParser.Package deletedPkg,
            PackageSetting deletedPs, int[] allUserHandles, int flags, PackageRemovedInfo outInfo,
            PackageSetting deletedPs, int[] allUserHandles, int flags,
            @Nullable PackageRemovedInfo outInfo,
            boolean writeSettings) {
        if (deletedPs.parentPackageName != null) {
            Slog.w(TAG, "Attempt to delete child system package " + deletedPkg.packageName);
@@ -16223,7 +16224,7 @@ public class PackageManagerService extends IPackageManager.Stub {
        }
        final boolean applyUserRestrictions
                = (allUserHandles != null) && (outInfo.origUsers != null);
                = (allUserHandles != null) && outInfo != null && (outInfo.origUsers != null);
        final PackageSetting disabledPs;
        // Confirm if the system package has been updated
        // An updated system app can be deleted. This will also have to restore
@@ -16253,6 +16254,7 @@ public class PackageManagerService extends IPackageManager.Stub {
            }
        }
        if (outInfo != null) {
            // Delete the updated package
            outInfo.isRemovedPackageSystemUpdate = true;
            if (outInfo.removedChildPackages != null) {
@@ -16270,6 +16272,7 @@ public class PackageManagerService extends IPackageManager.Stub {
                    }
                }
            }
        }
        if (disabledPs.versionCode < deletedPs.versionCode) {
            // Delete data for downgrades