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

Commit b17f9ee3 authored by Treehugger Robot's avatar Treehugger Robot Committed by Gerrit Code Review
Browse files

Merge "Handles null outInfo in deleteSystemPackageLI"

parents 471b839d d54f430b
Loading
Loading
Loading
Loading
+21 −17
Original line number Diff line number Diff line
@@ -18629,10 +18629,11 @@ public class PackageManagerService extends IPackageManager.Stub
     * Tries to delete system package.
     */
    private void deleteSystemPackageLIF(DeletePackageAction action, PackageSetting deletedPs,
            int[] allUserHandles, int flags, PackageRemovedInfo outInfo, boolean writeSettings)
            int[] allUserHandles, int flags, @Nullable PackageRemovedInfo outInfo,
            boolean writeSettings)
            throws SystemDeleteException {
        final boolean applyUserRestrictions
                = (allUserHandles != null) && (outInfo.origUsers != null);
        final boolean applyUserRestrictions =
                (allUserHandles != null) && outInfo != null && (outInfo.origUsers != null);
        final PackageParser.Package deletedPkg = deletedPs.pkg;
        // Confirm if the system package has been updated
        // An updated system app can be deleted. This will also have to restore
@@ -18653,6 +18654,7 @@ public class PackageManagerService extends IPackageManager.Stub
            }
        }
        if (outInfo != null) {
            // Delete the updated package
            outInfo.isRemovedPackageSystemUpdate = true;
            if (outInfo.removedChildPackages != null) {
@@ -18670,6 +18672,7 @@ public class PackageManagerService extends IPackageManager.Stub
                    }
                }
            }
        }
        if (disabledPs.versionCode < deletedPs.versionCode) {
            // Delete data for downgrades
@@ -18698,7 +18701,8 @@ public class PackageManagerService extends IPackageManager.Stub
        if (DEBUG_REMOVE) Slog.d(TAG, "Re-installing system package: " + disabledPs);
        try {
            installPackageFromSystemLIF(disabledPs.codePathString, allUserHandles,
                    outInfo.origUsers, deletedPs.getPermissionsState(), writeSettings);
                    outInfo == null ? null : outInfo.origUsers, deletedPs.getPermissionsState(),
                    writeSettings);
        } catch (PackageManagerException e) {
            Slog.w(TAG, "Failed to restore system package:" + deletedPkg.packageName + ": "
                    + e.getMessage());