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

Commit 570450d0 authored by Winson Chung's avatar Winson Chung
Browse files

Change logic to check recents bookend transition flag



- We are separating this from the top task tracking since they can land
  independently

Test: atest WMShellUnitTests
Flag: com.android.wm.shell.enable_recents_bookend_transition
Bug: 346588978

Change-Id: I34231086f89fe86cad0121bdde0d7cd73f0e9542
Signed-off-by: default avatarWinson Chung <winsonc@google.com>
parent 82f222ae
Loading
Loading
Loading
Loading
+8 −8
Original line number Diff line number Diff line
@@ -228,7 +228,7 @@ public class RecentsTransitionHandler implements Transitions.TransitionHandler,
                break;
            }
        }
        final int transitionType = Flags.enableShellTopTaskTracking()
        final int transitionType = Flags.enableRecentsBookendTransition()
                ? TRANSIT_START_RECENTS_TRANSITION
                : TRANSIT_TO_FRONT;
        final IBinder transition = mTransitions.startTransition(transitionType,
@@ -920,7 +920,7 @@ public class RecentsTransitionHandler implements Transitions.TransitionHandler,
                return;
            }

            if (Flags.enableShellTopTaskTracking()
            if (Flags.enableRecentsBookendTransition()
                    && info.getType() == TRANSIT_END_RECENTS_TRANSITION
                    && mergeTarget == mTransition) {
                // This is a pending finish, so merge the end transition to trigger completing the
@@ -1287,8 +1287,8 @@ public class RecentsTransitionHandler implements Transitions.TransitionHandler,
                return;
            }

            if (mFinishCB == null
                    || (Flags.enableShellTopTaskTracking() && mPendingFinishTransition != null)) {
            if (mFinishCB == null || (Flags.enableRecentsBookendTransition()
                    && mPendingFinishTransition != null)) {
                Slog.e(TAG, "Duplicate call to finish");
                if (runnerFinishCb != null) {
                    try {
@@ -1307,7 +1307,7 @@ public class RecentsTransitionHandler implements Transitions.TransitionHandler,
                    && !mWillFinishToHome
                    && mPausingTasks != null
                    && mState == STATE_NORMAL;
            if (!Flags.enableShellTopTaskTracking()) {
            if (!Flags.enableRecentsBookendTransition()) {
                // This is only necessary when the recents transition is finished using a finishWCT,
                // otherwise a new transition will notify the relevant observers
                if (returningToApp && allAppsAreTranslucent(mPausingTasks)) {
@@ -1440,7 +1440,7 @@ public class RecentsTransitionHandler implements Transitions.TransitionHandler,
                            // We need to clear the WCT to send finishWCT=null for Recents.
                            wct.clear();

                            if (Flags.enableShellTopTaskTracking()) {
                            if (Flags.enableRecentsBookendTransition()) {
                                // In this case, we've already started the PIP transition, so we can
                                // clean up immediately
                                mPendingRunnerFinishCb = runnerFinishCb;
@@ -1452,7 +1452,7 @@ public class RecentsTransitionHandler implements Transitions.TransitionHandler,
                }
            }

            if (Flags.enableShellTopTaskTracking()) {
            if (Flags.enableRecentsBookendTransition()) {
                if (!wct.isEmpty()) {
                    ProtoLog.v(ShellProtoLogGroup.WM_SHELL_RECENTS_TRANSITION,
                            "[%d] RecentsController.finishInner: "
@@ -1571,7 +1571,7 @@ public class RecentsTransitionHandler implements Transitions.TransitionHandler,
        /**
         * A temporary transition handler used with the pending finish transition, which runs the
         * cleanup/finish logic once the pending transition is merged/handled.
         * This is only initialized if Flags.enableShellTopTaskTracking() is enabled.
         * This is only initialized if Flags.enableRecentsBookendTransition() is enabled.
         */
        private class PendingFinishTransitionHandler implements Transitions.TransitionHandler {
            @Override
+2 −2
Original line number Diff line number Diff line
@@ -1380,7 +1380,7 @@ class WindowOrganizerController extends IWindowOrganizerController.Stub
                break;
            }
            case HIERARCHY_OP_TYPE_RESTORE_TRANSIENT_ORDER: {
                if (!com.android.wm.shell.Flags.enableShellTopTaskTracking()) {
                if (!com.android.wm.shell.Flags.enableRecentsBookendTransition()) {
                    // Only allow restoring transient order when finishing a transition
                    if (!chain.isFinishing()) break;
                }
@@ -1416,7 +1416,7 @@ class WindowOrganizerController extends IWindowOrganizerController.Stub
                final TaskDisplayArea taskDisplayArea = thisTask.getTaskDisplayArea();
                taskDisplayArea.moveRootTaskBehindRootTask(thisTask.getRootTask(), restoreAt);

                if (com.android.wm.shell.Flags.enableShellTopTaskTracking()) {
                if (com.android.wm.shell.Flags.enableRecentsBookendTransition()) {
                    // Because we are in a transient launch transition, the requested visibility of
                    // tasks does not actually change for the transient-hide tasks, but we do want
                    // the restoration of these transient-hide tasks to top to be a part of this