Always restart apps for full installs.

Bug: 219044664
Test: atest PackageManagerShellCommandTest
Change-Id: I920d4ae03d6337319ea9c07dacd317a754caf1c1
This commit is contained in:
Alex Buynytskyy
2022-05-27 07:55:00 -07:00
parent 0bdc2763a9
commit 93c2c2a292

View File

@@ -2837,6 +2837,11 @@ public class PackageInstallerSession extends IPackageInstallerSession.Stub {
if (!stagedSplits.contains(null)) {
throw new PackageManagerException(INSTALL_FAILED_INVALID_APK,
"Full install must include a base package");
} else if ((params.installFlags & PackageManager.INSTALL_DONT_KILL_APP) != 0) {
EventLog.writeEvent(0x534e4554, "219044664");
// Installing base.apk. Make sure the app is restarted.
params.setDontKillApp(false);
}
if (baseApk.isSplitRequired() && (stagedSplits.size() <= 1
|| !stagedSplitTypes.containsAll(requiredSplitTypes))) {