From 3fe70b2b61b16a0938bd7d8d4db3763b1b1d5275 Mon Sep 17 00:00:00 2001 From: Louis Chang Date: Fri, 9 Dec 2022 08:43:29 +0000 Subject: [PATCH] Searching and resuming the visible child Tasks behind invisible one The top-most Task was invisible because all activities in the Task was finishing. This somehow prevents the activities of Tasks behind from being resumed. Bug: 260691453 Test: atest TaskTests Test: Repro steps on the bug Change-Id: I1fdda18a118915b4328d62e9d0984581fafa4f44 --- services/core/java/com/android/server/wm/Task.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/services/core/java/com/android/server/wm/Task.java b/services/core/java/com/android/server/wm/Task.java index 292ed951b7e7b..33d8acd31fe89 100644 --- a/services/core/java/com/android/server/wm/Task.java +++ b/services/core/java/com/android/server/wm/Task.java @@ -4920,6 +4920,11 @@ class Task extends TaskFragment { } if (child.getVisibility(null /* starting */) != TASK_FRAGMENT_VISIBILITY_VISIBLE) { + if (child.topRunningActivity() == null) { + // Skip the task if no running activity and continue resuming next task. + continue; + } + // Otherwise, assuming everything behind this task should also be invisible. break; }