summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Treehugger Robot <android-test-infra-autosubmit@system.gserviceaccount.com> 2025-01-14 11:51:51 -0800
committer Gerrit Code Review <noreply-gerritcodereview@google.com> 2025-01-14 11:51:51 -0800
commit8ce3a8267cb35de480cd8cffcb3b0b977fb046ef (patch)
tree58c203e997095b6d0f4958575202006a1fdc98e4
parent93b38e1b4627adeff2aceb296997d653611cca17 (diff)
parent092371abae0d2fcf8fc62de77b3053c08252513b (diff)
Merge "don't call the reparent method when the old parent of task is removed." into main
-rw-r--r--services/core/java/com/android/server/wm/ActivityTaskSupervisor.java6
1 files changed, 6 insertions, 0 deletions
diff --git a/services/core/java/com/android/server/wm/ActivityTaskSupervisor.java b/services/core/java/com/android/server/wm/ActivityTaskSupervisor.java
index 9a3ad2d85de6..cebf1bee3439 100644
--- a/services/core/java/com/android/server/wm/ActivityTaskSupervisor.java
+++ b/services/core/java/com/android/server/wm/ActivityTaskSupervisor.java
@@ -1655,6 +1655,12 @@ public class ActivityTaskSupervisor implements RecentTasks.Callbacks {
activityIdleInternal(null /* idleActivity */, false /* fromTimeout */,
true /* processPausingActivities */, null /* configuration */);
+ if (rootTask.getParent() == null) {
+ // The activities in the task may already be finishing. Then the task could be removed
+ // when performing the idle check.
+ return;
+ }
+
// Reparent all the tasks to the bottom of the display
final DisplayContent toDisplay =
mRootWindowContainer.getDisplayContent(DEFAULT_DISPLAY);