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

Commit 52d5f426 authored by lumark's avatar lumark
Browse files

Make WC#applyAnimation can apply on Task / TaskStack layer (3/N)

Correct isAnimating check in ActivityStackSupervisor
to fix when enabled hierarchical animation, the app launching remote
animation can't work for the 2nd launch because
activityIdleInternal -> schedule StopActivityItem comes too quick and
makes launcher will reset the remote animation when onStop received.

Also, consolidate checks in AppTransition#goodToGo for topOpenAnim to
fix test flaky on MultiDisplayPolicyTests#testNoLeakOnExternalDisplay.

And, revert commit 5341d1c7 for modification of WC#isWaitingForTransitionStart
since it will break isAnimating(TRANSITIONS | PARENTS) usage to traverse
child activity if is waiting for transition but actually user don't add CHILDREN
flag.

Bug: 142617871
Bug: 131661052
Test: all existing tests passed

Change-Id: Ia0bb09b009c738bd27afe241ad383ddbb383a0fc
parent 7b469d73
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -83,6 +83,7 @@ import static com.android.server.wm.Task.LOCK_TASK_AUTH_WHITELISTED;
import static com.android.server.wm.Task.REPARENT_KEEP_STACK_AT_FRONT;
import static com.android.server.wm.Task.REPARENT_LEAVE_STACK_IN_PLACE;
import static com.android.server.wm.Task.REPARENT_MOVE_STACK_TO_FRONT;
import static com.android.server.wm.WindowContainer.AnimationFlags.PARENTS;
import static com.android.server.wm.WindowContainer.AnimationFlags.TRANSITION;
import static com.android.server.wm.WindowContainer.POSITION_TOP;

@@ -2079,7 +2080,7 @@ public class ActivityStackSupervisor implements RecentTasks.Callbacks {
        ArrayList<ActivityRecord> readyToStopActivities = null;
        for (int i = mStoppingActivities.size() - 1; i >= 0; --i) {
            final ActivityRecord s = mStoppingActivities.get(i);
            final boolean animating = s.isAnimating(TRANSITION);
            final boolean animating = s.isAnimating(TRANSITION | PARENTS);
            if (DEBUG_STATES) Slog.v(TAG, "Stopping " + s + ": nowVisible=" + s.nowVisible
                    + " animating=" + animating + " finishing=" + s.finishing);

+3 −4
Original line number Diff line number Diff line
@@ -436,10 +436,9 @@ public class AppTransition implements Dump {
        mNextAppTransition = TRANSIT_UNSET;
        mNextAppTransitionFlags = 0;
        setAppTransitionState(APP_STATE_RUNNING);
        final AnimationAdapter topOpeningAnim =
                (topOpeningApp != null && topOpeningApp.getAnimatingContainer() != null)
                        ? topOpeningApp.getAnimatingContainer().getAnimation()
                        : null;
        final WindowContainer wc =
                topOpeningApp != null ? topOpeningApp.getAnimatingContainer() : null;
        final AnimationAdapter topOpeningAnim = wc != null ? wc.getAnimation() : null;

        int redoLayout = notifyAppTransitionStartingLocked(transit,
                topOpeningAnim != null ? topOpeningAnim.getDurationHint() : 0,
+1 −1
Original line number Diff line number Diff line
@@ -777,7 +777,7 @@ class WindowContainer<E extends WindowContainer> extends ConfigurationContainer<
     *         otherwise.
     */
    boolean isWaitingForTransitionStart() {
        return getActivity(app -> app.isWaitingForTransitionStart()) != null;
        return false;
    }

    /**