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