summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Evan Rosky <erosky@google.com> 2024-05-10 15:32:06 -0700
committer Evan Rosky <erosky@google.com> 2024-05-14 17:03:22 +0000
commit60386b822bdc44e26331a79433b0fb80163f6aee (patch)
tree117819066456e2ed5495d9db416d4a2a3d0d2f22
parent9e267f728dd333608052dd827f3f1a5f91058ad7 (diff)
Make sure an isolated removeTask becomes ready
If this removeTask happens without any consequent actions (eg. removing a pip task and nothing starts as a result), the transition system needs to interpret it as ready immediately. Bug: 339135761 Test: Open netflix video in pip, go to recents and restore netflix Change-Id: I14bed6164e12bd4d36c24870738188f5e89a4eb1 Merged-In: I14bed6164e12bd4d36c24870738188f5e89a4eb1 (cherry picked from commit 31a9c1f4ff2310f51625b9b5e975a5f501316a0b)
-rw-r--r--services/core/java/com/android/server/wm/ActivityTaskSupervisor.java11
1 files changed, 10 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 a3a06d404a2e..f9c2c7ef8066 100644
--- a/services/core/java/com/android/server/wm/ActivityTaskSupervisor.java
+++ b/services/core/java/com/android/server/wm/ActivityTaskSupervisor.java
@@ -1689,7 +1689,16 @@ public class ActivityTaskSupervisor implements RecentTasks.Callbacks {
// Prevent recursion.
return;
}
- task.mTransitionController.requestCloseTransitionIfNeeded(task);
+ final Transition transit = task.mTransitionController.requestCloseTransitionIfNeeded(task);
+ if (transit != null && !task.mTransitionController.useFullReadyTracking()) {
+ // If a transition was created here, it means this is an isolated removeTask. It's
+ // possible for there to be no consequent operations (eg. this is a multiwindow task
+ // closing so nothing becomes visible in response) so we must "touch" the old ready
+ // tracker so that it doesn't get stuck. However, since the old ready tracker
+ // doesn't support multiple conditions, we have to touch it here at the beginning
+ // before anything that may need it to wait (setReady(false)).
+ transit.setReady(task, true);
+ }
// Consume the stopping activities immediately so activity manager won't skip killing
// the process because it is still foreground state, i.e. RESUMED -> PAUSING set from
// removeActivities -> finishIfPossible.