From dd21fabb740ec61e7c0cb1fd5c75e56494af123f Mon Sep 17 00:00:00 2001 From: Ming-Shin Lu Date: Wed, 16 Jun 2021 13:50:42 +0800 Subject: [PATCH] Don't promote the animation on Task's parent when clearing task We cannot promote the transition animation on Task's parent when the task is in clearing task, in case the animation get stuck when performing the opening task transition that behind it. Fix: 176492094 Test: manual as issue steps in setup wizard: 1. complete initial setup without connection 2. finish the pre-deferred setup by setting up Wi-Fi connection 3. remove the Wi-Fi connection from settings page 4. launch deferred setup from notification 5. choose offline setup on Network settings page 6. complete deferred setup 7. observe the behaviour if the transition is janky when backing to home Change-Id: I50fba3a7681c7d53e0caddf84315d6e6c76e9e92 --- .../java/com/android/server/wm/AppTransitionController.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/services/core/java/com/android/server/wm/AppTransitionController.java b/services/core/java/com/android/server/wm/AppTransitionController.java index e7c51a4ac65ad..23155a042a677 100644 --- a/services/core/java/com/android/server/wm/AppTransitionController.java +++ b/services/core/java/com/android/server/wm/AppTransitionController.java @@ -623,7 +623,11 @@ public class AppTransitionController { siblings.add(current); boolean canPromote = true; - if (parent == null || !parent.canCreateRemoteAnimationTarget()) { + if (parent == null || !parent.canCreateRemoteAnimationTarget() + // We cannot promote the animation on Task's parent when the task is in + // clearing task in case the animating get stuck when performing the opening + // task that behind it. + || (current.asTask() != null && current.asTask().mInRemoveTask)) { canPromote = false; } else { // In case a descendant of the parent belongs to the other group, we cannot promote