Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 68caca90 authored by Issei Suzuki's avatar Issei Suzuki
Browse files

Fix CTS test failure with hierarchical animation enabled.

Defer removal of ActivityRecord while its parent is animating.
With hierarchical animation enabled, some animations are applied on
ActivityStack instead of ActivityRecord. In this case, removal of
ActivityRecord must be deferred until the animation finishes, since
a surface having a frame buffer is tight with an ActivityRecord.

Cancel animation before moving Tasks from the pinned stack to
fullscreen stack.

Bug: 131661052
Test: atest ActivityLifecycleTopResumedStateTests
Change-Id: Iee5a31d06646ed681abdd6623a0d0a6a7763a4a9
parent c1b5370b
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -3088,7 +3088,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()) {
+1 −0
Original line number Diff line number Diff line
@@ -1713,6 +1713,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;
+4 −3
Original line number Diff line number Diff line
@@ -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;
                    }
                }