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

Commit 34f230aa authored by Jeff Sharkey's avatar Jeff Sharkey Committed by Android Git Automerger
Browse files

am c5418198: am 3438bc1b: Merge "Correctly rollback failed system app installs." into lmp-dev

* commit 'c5418198':
  Correctly rollback failed system app installs.
parents 23f07789 c5418198
Loading
Loading
Loading
Loading
+7 −3
Original line number Diff line number Diff line
@@ -10049,6 +10049,7 @@ public class PackageManagerService extends IPackageManager.Stub {
            String installerPackageName, PackageInstalledInfo res) {
        if (DEBUG_INSTALL) Slog.d(TAG, "replaceSystemPackageLI: new=" + pkg
                + ", old=" + deletedPackage);
        boolean disabledSystem = false;
        boolean updatedSettings = false;
        parseFlags |= PackageParser.PARSE_IS_SYSTEM;
        if ((deletedPackage.applicationInfo.flags&ApplicationInfo.FLAG_PRIVILEGED) != 0) {
@@ -10082,7 +10083,8 @@ public class PackageManagerService extends IPackageManager.Stub {
        removePackageLI(oldPkgSetting, true);
        // writer
        synchronized (mPackages) {
            if (!mSettings.disableSystemPackageLPw(packageName) && deletedPackage != null) {
            disabledSystem = mSettings.disableSystemPackageLPw(packageName);
            if (!disabledSystem && deletedPackage != null) {
                // We didn't need to disable the .apk as a current system package,
                // which means we are replacing another update that is already
                // installed.  We need to make sure to delete the older one's .apk.
@@ -10142,8 +10144,10 @@ public class PackageManagerService extends IPackageManager.Stub {
            }
            // Restore the old system information in Settings
            synchronized (mPackages) {
                if (updatedSettings) {
                if (disabledSystem) {
                    mSettings.enableSystemPackageLPw(packageName);
                }
                if (updatedSettings) {
                    mSettings.setInstallerPackageName(packageName,
                            oldPkgSetting.installerPackageName);
                }