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

Commit 6c0b72fe authored by Winson Chung's avatar Winson Chung Committed by Android (Google) Code Review
Browse files

Merge "Hide both pausing and closing tasks when finishing the recents transition" into main

parents ab60847a f7921eec
Loading
Loading
Loading
Loading
+18 −10
Original line number Diff line number Diff line
@@ -995,16 +995,10 @@ public class RecentsTransitionHandler implements Transitions.TransitionHandler {
                    t.show(mOpeningTasks.get(i).mTaskSurface);
                }
                for (int i = 0; i < mPausingTasks.size(); ++i) {
                    if (!sendUserLeaveHint && mPausingTasks.get(i).isLeaf()) {
                        // This means recents is not *actually* finishing, so of course we gotta
                        // do special stuff in WMCore to accommodate.
                        wct.setDoNotPip(mPausingTasks.get(i).mToken);
                    cleanUpPausingOrClosingTask(mPausingTasks.get(i), wct, t, sendUserLeaveHint);
                }
                    // Since we will reparent out of the leashes, pre-emptively hide the child
                    // surface to match the leash. Otherwise, there will be a flicker before the
                    // visibility gets committed in Core when using split-screen (in splitscreen,
                    // the leaf-tasks are not "independent" so aren't hidden by normal setup).
                    t.hide(mPausingTasks.get(i).mTaskSurface);
                for (int i = 0; i < mClosingTasks.size(); ++i) {
                    cleanUpPausingOrClosingTask(mClosingTasks.get(i), wct, t, sendUserLeaveHint);
                }
                if (mPipTransaction != null && sendUserLeaveHint) {
                    SurfaceControl pipLeash = null;
@@ -1053,6 +1047,20 @@ public class RecentsTransitionHandler implements Transitions.TransitionHandler {
            }
        }

        private void cleanUpPausingOrClosingTask(TaskState task, WindowContainerTransaction wct,
                SurfaceControl.Transaction finishTransaction, boolean sendUserLeaveHint) {
            if (!sendUserLeaveHint && task.isLeaf()) {
                // This means recents is not *actually* finishing, so of course we gotta
                // do special stuff in WMCore to accommodate.
                wct.setDoNotPip(task.mToken);
            }
            // Since we will reparent out of the leashes, pre-emptively hide the child
            // surface to match the leash. Otherwise, there will be a flicker before the
            // visibility gets committed in Core when using split-screen (in splitscreen,
            // the leaf-tasks are not "independent" so aren't hidden by normal setup).
            finishTransaction.hide(task.mTaskSurface);
        }

        @Override
        public void setDeferCancelUntilNextTransition(boolean defer, boolean screenshot) {
        }
+5 −0
Original line number Diff line number Diff line
@@ -330,6 +330,11 @@ public class TaskViewTransitions implements Transitions.TransitionHandler {
                    continue;
                }
                if (isHide) {
                    if (pending.mType == TRANSIT_TO_BACK) {
                        // TO_BACK is only used when setting the task view visibility immediately,
                        // so in that case we can also hide the surface immediately
                        startTransaction.hide(chg.getLeash());
                    }
                    tv.prepareHideAnimation(finishTransaction);
                } else {
                    tv.prepareCloseAnimation();