diff options
| author | 2019-01-04 16:47:42 +0800 | |
|---|---|---|
| committer | 2019-01-07 03:03:31 +0000 | |
| commit | 917173f5709b1042d74e21280635e3807c559af1 (patch) | |
| tree | 954b7bf7d384df59150a0a9e20f11765306e37f2 | |
| parent | 1f343b5efcd8a1464b8e36169f14a753979e26a2 (diff) | |
Restart the application only for the bad process
The case is a test using the same package name as default home.
Starting the instrumentation of the test will kill the home process.
When AM try to restart the default home, there is a wrong logic that
cause the instrumentation process to be killled.
The problem of original logic is always set knownToBeDead as true even
the existing process is ok.
Test: atest CtsAppTestCases#ServiceTest
Bug: 120107272
Change-Id: Ic2c3f6236c3631b0e386d24750bf5952d8227ea9
| -rw-r--r-- | services/core/java/com/android/server/wm/ActivityStackSupervisor.java | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/services/core/java/com/android/server/wm/ActivityStackSupervisor.java b/services/core/java/com/android/server/wm/ActivityStackSupervisor.java index d5286b9ae87c..a50ae8431cb0 100644 --- a/services/core/java/com/android/server/wm/ActivityStackSupervisor.java +++ b/services/core/java/com/android/server/wm/ActivityStackSupervisor.java @@ -947,6 +947,7 @@ public class ActivityStackSupervisor implements RecentTasks.Callbacks { final WindowProcessController wpc = mService.getProcessController(r.processName, r.info.applicationInfo.uid); + boolean knownToBeDead = false; if (wpc != null && wpc.hasThread()) { try { if ((r.info.flags & ActivityInfo.FLAG_MULTIPROCESS) == 0 @@ -965,6 +966,7 @@ public class ActivityStackSupervisor implements RecentTasks.Callbacks { // If a dead object exception was thrown -- fall through to // restart the application. + knownToBeDead = true; } // Suppress transition until the new activity becomes ready, otherwise the keyguard can @@ -978,7 +980,7 @@ public class ActivityStackSupervisor implements RecentTasks.Callbacks { // ATMS lock held. final Message msg = PooledLambda.obtainMessage( ActivityManagerInternal::startProcess, mService.mAmInternal, r.processName, - r.info.applicationInfo, true, "activity", r.intent.getComponent()); + r.info.applicationInfo, knownToBeDead, "activity", r.intent.getComponent()); mService.mH.sendMessage(msg); } |