summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Louis Chang <louischang@google.com> 2023-06-09 08:31:24 +0000
committer Louis Chang <louischang@google.com> 2023-06-09 09:12:54 +0000
commitae44d64d17b1707ccaecdbb0184b71c710820fc0 (patch)
treec12e327f6e35e7b8234c615f8e43832806f82fde
parent5f433062b0b1390a5da6711b6c5d40e53b5b7d2d (diff)
Do not wait for Activity#onDestroy if the activity has no process
The activity process was killed by force stopping the app package in #teardown, but the activity was deferred to be removed from wm hierarchy due to in transition. Before the transition completed, a kill-task-process message was scheduled because the app task was requested to be removed by the test. The app process that started afterward could then be killed once the timeout occurs. Bug: 286349050 Test: atest DisplayTests Change-Id: I8c70c25342fd373c812f535bd2bc47da4038af04
-rw-r--r--services/core/java/com/android/server/wm/ActivityTaskSupervisor.java2
1 files changed, 1 insertions, 1 deletions
diff --git a/services/core/java/com/android/server/wm/ActivityTaskSupervisor.java b/services/core/java/com/android/server/wm/ActivityTaskSupervisor.java
index 3c976725cfee..738797b809a5 100644
--- a/services/core/java/com/android/server/wm/ActivityTaskSupervisor.java
+++ b/services/core/java/com/android/server/wm/ActivityTaskSupervisor.java
@@ -1891,7 +1891,7 @@ public class ActivityTaskSupervisor implements RecentTasks.Callbacks {
// DestroyActivityItem may be called first.
final ActivityRecord top = task.getTopMostActivity();
if (top != null && top.finishing && !top.mAppStopped && top.lastVisibleTime > 0
- && !task.mKillProcessesOnDestroyed) {
+ && !task.mKillProcessesOnDestroyed && top.hasProcess()) {
task.mKillProcessesOnDestroyed = true;
mHandler.sendMessageDelayed(
mHandler.obtainMessage(KILL_TASK_PROCESSES_TIMEOUT_MSG, task),