diff options
3 files changed, 10 insertions, 4 deletions
diff --git a/services/core/java/com/android/server/wm/ActivityRecord.java b/services/core/java/com/android/server/wm/ActivityRecord.java index dda11f96cc8a..b05c25082f85 100644 --- a/services/core/java/com/android/server/wm/ActivityRecord.java +++ b/services/core/java/com/android/server/wm/ActivityRecord.java @@ -3074,7 +3074,11 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A mStackSupervisor.getActivityMetricsLogger().notifyActivityRemoved(this); waitingToShow = false; - boolean delayed = isAnimating(TRANSITION | CHILDREN); + // Defer removal of this activity when either a child is animating, or app transition is on + // going. App transition animation might be applied on the parent stack not on the activity, + // but the actual frame buffer is associated with the activity, so we have to keep the + // activity while a parent is animating. + boolean delayed = isAnimating(TRANSITION | PARENTS | CHILDREN); if (getDisplayContent().mClosingApps.contains(this)) { delayed = true; } else if (getDisplayContent().mAppTransition.isTransitionSet()) { diff --git a/services/core/java/com/android/server/wm/ActivityStackSupervisor.java b/services/core/java/com/android/server/wm/ActivityStackSupervisor.java index 362e781f7fb9..a513ef8f3190 100644 --- a/services/core/java/com/android/server/wm/ActivityStackSupervisor.java +++ b/services/core/java/com/android/server/wm/ActivityStackSupervisor.java @@ -1711,6 +1711,7 @@ public class ActivityStackSupervisor implements RecentTasks.Callbacks { * invisible as well and added to the stopping list. After which we process the * stopping list by handling the idle. */ + stack.cancelAnimation(); stack.mForceHidden = true; stack.ensureActivitiesVisible(null, 0, PRESERVE_WINDOWS); stack.mForceHidden = false; diff --git a/services/core/java/com/android/server/wm/AppTransitionController.java b/services/core/java/com/android/server/wm/AppTransitionController.java index 3927d5fa2604..0798a910c860 100644 --- a/services/core/java/com/android/server/wm/AppTransitionController.java +++ b/services/core/java/com/android/server/wm/AppTransitionController.java @@ -431,6 +431,8 @@ public class AppTransitionController { while (!candidates.isEmpty()) { final WindowContainer current = candidates.removeFirst(); final WindowContainer parent = current.getParent(); + siblings.clear(); + siblings.add(current); boolean canPromote = true; if (parent == null) { @@ -468,12 +470,11 @@ public class AppTransitionController { // // [Task] +- [ActivityRecord1] (visible, in opening apps) // +- [ActivityRecord2] (visible, not in opening apps) - siblings.clear(); for (int j = 0; j < parent.getChildCount(); ++j) { final WindowContainer sibling = parent.getChildAt(j); - if (sibling == current || candidates.remove(sibling)) { + if (candidates.remove(sibling)) { siblings.add(sibling); - } else if (sibling.isVisible()) { + } else if (sibling != current && sibling.isVisible()) { canPromote = false; } } |