From 1cc7b14c4577d3dda28b036688f2d3541c347832 Mon Sep 17 00:00:00 2001 From: Jackal Guo Date: Thu, 13 Jan 2022 01:51:29 +0000 Subject: [PATCH] Revert "Mitigate the races during installation." This reverts commit e39801390563f3f6a67e06d1338d3f099a93f564. Reason for revert: b/214088468. Break device policy test infra. Change-Id: I7c7f5b91777e7b420b73bdf625800f622b818058 --- .../java/com/android/server/am/ActivityManagerService.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/services/core/java/com/android/server/am/ActivityManagerService.java b/services/core/java/com/android/server/am/ActivityManagerService.java index fbaf2f04f7fc7..a33aa600febdf 100644 --- a/services/core/java/com/android/server/am/ActivityManagerService.java +++ b/services/core/java/com/android/server/am/ActivityManagerService.java @@ -13372,7 +13372,12 @@ public class ActivityManagerService extends IActivityManager.Stub !intent.getBooleanExtra(Intent.EXTRA_DONT_KILL_APP, false); final boolean fullUninstall = removed && !replacing; if (removed) { - if (!killProcess) { + if (killProcess) { + forceStopPackageLocked(ssp, UserHandle.getAppId( + intent.getIntExtra(Intent.EXTRA_UID, -1)), + false, true, true, false, fullUninstall, userId, + removed ? "pkg removed" : "pkg changed"); + } else { // Kill any app zygotes always, since they can't fork new // processes with references to the old code forceStopAppZygoteLocked(ssp, UserHandle.getAppId(