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

Commit 332973d1 authored by Dario Freni's avatar Dario Freni Committed by android-build-merger
Browse files

Merge "Merge "Enable upgrading persistent APKs on boot." into qt-dev am:...

Merge "Merge "Enable upgrading persistent APKs on boot." into qt-dev am: f400227e" into qt-dev-plus-aosp
am: 905ffc20

Change-Id: I545bd49fe09764c946f1f8f45520c39bc20cce9b
parents 872344f1 905ffc20
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -939,6 +939,7 @@ public class PackageManagerService extends IPackageManager.Stub
    ComponentName mCustomResolverComponentName;
    boolean mResolverReplaced = false;
    boolean mOkToReplacePersistentPackages = false;
    private final @Nullable ComponentName mIntentFilterVerifierComponent;
    private final @Nullable IntentFilterVerifier<ActivityIntentInfo> mIntentFilterVerifier;
@@ -17330,7 +17331,8 @@ public class PackageManagerService extends IPackageManager.Stub
                                        + " target SDK " + oldTargetSdk + " does.");
                    }
                    // Prevent persistent apps from being updated
                    if ((oldPackage.applicationInfo.flags & ApplicationInfo.FLAG_PERSISTENT) != 0) {
                    if (((oldPackage.applicationInfo.flags & ApplicationInfo.FLAG_PERSISTENT) != 0)
                            && !mOkToReplacePersistentPackages) {
                        throw new PrepareFailure(PackageManager.INSTALL_FAILED_INVALID_APK,
                                "Package " + oldPackage.packageName + " is a persistent app. "
                                        + "Persistent apps are not updateable.");
@@ -21510,10 +21512,12 @@ public class PackageManagerService extends IPackageManager.Stub
        mModuleInfoProvider.systemReady();
        mOkToReplacePersistentPackages = true;
        // Installer service might attempt to install some packages that have been staged for
        // installation on reboot. Make sure this is the last component to be call since the
        // installation might require other components to be ready.
        mInstallerService.restoreAndApplyStagedSessionIfNeeded();
        mOkToReplacePersistentPackages = false;
    }
    public void waitForAppDataPrepared() {