Merge "Merge "Enable upgrading persistent APKs on boot." into qt-dev am: f400227e7e" into qt-dev-plus-aosp
This commit is contained in:
committed by
Android (Google) Code Review
commit
905ffc20f3
@@ -939,6 +939,7 @@ public class PackageManagerService extends IPackageManager.Stub
|
|||||||
ComponentName mCustomResolverComponentName;
|
ComponentName mCustomResolverComponentName;
|
||||||
|
|
||||||
boolean mResolverReplaced = false;
|
boolean mResolverReplaced = false;
|
||||||
|
boolean mOkToReplacePersistentPackages = false;
|
||||||
|
|
||||||
private final @Nullable ComponentName mIntentFilterVerifierComponent;
|
private final @Nullable ComponentName mIntentFilterVerifierComponent;
|
||||||
private final @Nullable IntentFilterVerifier<ActivityIntentInfo> mIntentFilterVerifier;
|
private final @Nullable IntentFilterVerifier<ActivityIntentInfo> mIntentFilterVerifier;
|
||||||
@@ -17325,7 +17326,8 @@ public class PackageManagerService extends IPackageManager.Stub
|
|||||||
+ " target SDK " + oldTargetSdk + " does.");
|
+ " target SDK " + oldTargetSdk + " does.");
|
||||||
}
|
}
|
||||||
// Prevent persistent apps from being updated
|
// 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,
|
throw new PrepareFailure(PackageManager.INSTALL_FAILED_INVALID_APK,
|
||||||
"Package " + oldPackage.packageName + " is a persistent app. "
|
"Package " + oldPackage.packageName + " is a persistent app. "
|
||||||
+ "Persistent apps are not updateable.");
|
+ "Persistent apps are not updateable.");
|
||||||
@@ -21505,10 +21507,12 @@ public class PackageManagerService extends IPackageManager.Stub
|
|||||||
|
|
||||||
mModuleInfoProvider.systemReady();
|
mModuleInfoProvider.systemReady();
|
||||||
|
|
||||||
|
mOkToReplacePersistentPackages = true;
|
||||||
// Installer service might attempt to install some packages that have been staged for
|
// 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 on reboot. Make sure this is the last component to be call since the
|
||||||
// installation might require other components to be ready.
|
// installation might require other components to be ready.
|
||||||
mInstallerService.restoreAndApplyStagedSessionIfNeeded();
|
mInstallerService.restoreAndApplyStagedSessionIfNeeded();
|
||||||
|
mOkToReplacePersistentPackages = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void waitForAppDataPrepared() {
|
public void waitForAppDataPrepared() {
|
||||||
|
|||||||
Reference in New Issue
Block a user