Mitigate the races during installation.
During the installation of update, the application would be killed twice. The first one is done by PackageFreezer. It kills and freezes the application while starting installing. The second one happens just after the package is unfrozen. Since the application won't be able to be started when it's frozen. The second kill is a little overkill to me. It's possible that someone starts the application before the second kill comes. Skip the second kill to mitigate the possible race. Bug: 165012101 Test: atest PackageManagerTest Change-Id: I5085547ba3f20c370474228deb13bbc24064ae21
This commit is contained in:
@@ -13372,12 +13372,7 @@ public class ActivityManagerService extends IActivityManager.Stub
|
||||
!intent.getBooleanExtra(Intent.EXTRA_DONT_KILL_APP, false);
|
||||
final boolean fullUninstall = removed && !replacing;
|
||||
if (removed) {
|
||||
if (killProcess) {
|
||||
forceStopPackageLocked(ssp, UserHandle.getAppId(
|
||||
intent.getIntExtra(Intent.EXTRA_UID, -1)),
|
||||
false, true, true, false, fullUninstall, userId,
|
||||
removed ? "pkg removed" : "pkg changed");
|
||||
} else {
|
||||
if (!killProcess) {
|
||||
// Kill any app zygotes always, since they can't fork new
|
||||
// processes with references to the old code
|
||||
forceStopAppZygoteLocked(ssp, UserHandle.getAppId(
|
||||
|
||||
Reference in New Issue
Block a user