Loading libs/WindowManager/Shell/aconfig/multitasking.aconfig +0 −10 Original line number Diff line number Diff line Loading @@ -117,16 +117,6 @@ flag { } } flag { name: "enable_recents_bookend_transition" namespace: "multitasking" description: "Use a finish-transition to clean up recents instead of the finish-WCT" bug: "346588978" metadata { purpose: PURPOSE_BUGFIX } } flag { name: "enable_bubble_to_fullscreen" namespace: "multitasking" Loading libs/WindowManager/Shell/src/com/android/wm/shell/recents/RecentsTransitionHandler.java +46 −77 Original line number Diff line number Diff line Loading @@ -284,10 +284,7 @@ public class RecentsTransitionHandler implements Transitions.TransitionHandler, break; } } final int transitionType = Flags.enableRecentsBookendTransition() ? TRANSIT_START_RECENTS_TRANSITION : TRANSIT_TO_FRONT; final IBinder transition = mTransitions.startTransition(transitionType, final IBinder transition = mTransitions.startTransition(TRANSIT_START_RECENTS_TRANSITION, wct, mixer == null ? this : mixer); if (mixer != null) { setTransitionForMixer.accept(transition); Loading Loading @@ -474,8 +471,7 @@ public class RecentsTransitionHandler implements Transitions.TransitionHandler, // next called. private Pair<int[], TaskSnapshot[]> mPendingPauseSnapshotsForCancel; // Used to track a pending finish transition, this is only non-null if // enableRecentsBookendTransition() is enabled // Used to track a pending finish transition private IBinder mPendingFinishTransition; private IResultReceiver mPendingRunnerFinishCb; // This stores the pending finish transaction to merge with the actual finish transaction Loading Loading @@ -1067,7 +1063,6 @@ public class RecentsTransitionHandler implements Transitions.TransitionHandler, return; } if (Flags.enableRecentsBookendTransition()) { if (info.getType() == TRANSIT_END_RECENTS_TRANSITION) { // This is a pending finish, so merge the end transition to trigger completing // the cleanup of the recents transition Loading @@ -1086,7 +1081,6 @@ public class RecentsTransitionHandler implements Transitions.TransitionHandler, onFinishInner(null /* wct */); return; } } if (info.getType() == TRANSIT_SLEEP) { ProtoLog.v(ShellProtoLogGroup.WM_SHELL_RECENTS_TRANSITION, Loading Loading @@ -1557,8 +1551,7 @@ public class RecentsTransitionHandler implements Transitions.TransitionHandler, return; } if (mFinishCB == null || (Flags.enableRecentsBookendTransition() && mPendingFinishTransition != null)) { if (mFinishCB == null || mPendingFinishTransition != null) { Slog.e(TAG, "Duplicate call to finish"); if (runnerFinishCb != null) { try { Loading @@ -1579,21 +1572,6 @@ public class RecentsTransitionHandler implements Transitions.TransitionHandler, && !mWillFinishToHome && mPausingTasks != null && mState == STATE_NORMAL; 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)) { mHomeTransitionObserver.notifyHomeVisibilityChanged(true); } else if (!toHome && mState == STATE_NEW_TASK && allAppsAreTranslucent(mOpeningTasks)) { // We are opening a translucent app. Launcher is still visible so we do nothing. } else if (!toHome) { // For some transitions, we may have notified home activity that it became // visible. We need to notify the observer that we are no longer going home. mHomeTransitionObserver.notifyHomeVisibilityChanged(false); } } ProtoLog.v(ShellProtoLogGroup.WM_SHELL_RECENTS_TRANSITION, "[%d] RecentsController.finishInner: toHome=%b userLeave=%b " + "willFinishToHome=%b state=%d hasPausingTasks=%b reason=%s", Loading Loading @@ -1747,7 +1725,6 @@ public class RecentsTransitionHandler implements Transitions.TransitionHandler, // We need to clear the WCT to send finishWCT=null for Recents. wct.clear(); if (Flags.enableRecentsBookendTransition()) { // Notify the mixers of the pending finish for (int i = 0; i < mMixers.size(); ++i) { mMixers.get(i).handleFinishRecents(returningToApp, wct, t); Loading @@ -1763,14 +1740,12 @@ public class RecentsTransitionHandler implements Transitions.TransitionHandler, } } } } // Notify the mixers of the pending finish for (int i = 0; i < mMixers.size(); ++i) { mMixers.get(i).handleFinishRecents(returningToApp, wct, t); } if (Flags.enableRecentsBookendTransition()) { if (!wct.isEmpty()) { if (requiresBookendTransition) { ProtoLog.v(ShellProtoLogGroup.WM_SHELL_RECENTS_TRANSITION, Loading @@ -1795,11 +1770,6 @@ public class RecentsTransitionHandler implements Transitions.TransitionHandler, mPendingFinishTransaction = t; onFinishInner(null /* wct */); } } else { mPendingRunnerFinishCb = runnerFinishCb; mPendingFinishTransaction = t; onFinishInner(wct); } } /** Loading Loading @@ -1931,7 +1901,6 @@ 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.enableRecentsBookendTransition() is enabled. */ private class PendingFinishTransitionHandler implements Transitions.TransitionHandler { @Override Loading libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/recents/RecentsTransitionHandlerTest.java +1 −5 Original line number Diff line number Diff line Loading @@ -30,7 +30,6 @@ import static com.android.window.flags.Flags.FLAG_ENABLE_DESKTOP_RECENTS_TRANSIT import static com.android.window.flags.Flags.FLAG_ENABLE_DESKTOP_SPLITSCREEN_TRANSITION_BUGFIX; import static com.android.window.flags.Flags.FLAG_ENABLE_MULTIPLE_DESKTOPS_BACKEND; import static com.android.wm.shell.Flags.FLAG_ENABLE_PIP2; import static com.android.wm.shell.Flags.FLAG_ENABLE_RECENTS_BOOKEND_TRANSITION; import static com.android.wm.shell.Flags.FLAG_FIX_BUBBLES_TO_RECENTS; import static com.android.wm.shell.recents.RecentsTransitionStateListener.TRANSITION_STATE_ANIMATING; import static com.android.wm.shell.recents.RecentsTransitionStateListener.TRANSITION_STATE_NOT_RUNNING; Loading Loading @@ -396,7 +395,6 @@ public class RecentsTransitionHandlerTest extends ShellTestCase { } @Test @EnableFlags(FLAG_ENABLE_RECENTS_BOOKEND_TRANSITION) public void testMerge_consumeBookendTransition() throws Exception { // Start and finish the transition final IRecentsAnimationRunner animationRunner = mock(IRecentsAnimationRunner.class); Loading Loading @@ -428,7 +426,6 @@ public class RecentsTransitionHandlerTest extends ShellTestCase { } @Test @EnableFlags(FLAG_ENABLE_RECENTS_BOOKEND_TRANSITION) public void testMerge_pendingBookendTransition_mergesTransition() throws Exception { // Start and finish the transition final IRecentsAnimationRunner animationRunner = mock(IRecentsAnimationRunner.class); Loading Loading @@ -575,7 +572,6 @@ public class RecentsTransitionHandlerTest extends ShellTestCase { } @Test @EnableFlags(FLAG_ENABLE_RECENTS_BOOKEND_TRANSITION) public void testMerge_cancelToHome_onTransitSleep() throws Exception { TransitionInfo mergeTransitionInfo = new TransitionInfoBuilder(TRANSIT_SLEEP) .build(); Loading @@ -583,7 +579,7 @@ public class RecentsTransitionHandlerTest extends ShellTestCase { } @Test @EnableFlags({FLAG_ENABLE_RECENTS_BOOKEND_TRANSITION, FLAG_ENABLE_PIP2}) @EnableFlags(FLAG_ENABLE_PIP2) public void testMerge_cancelToHome_onTransitRemovePip() throws Exception { TransitionInfo mergeTransitionInfo = new TransitionInfoBuilder(TRANSIT_REMOVE_PIP) .build(); Loading libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/splitscreen/SplitTransitionTests.java +4 −16 Original line number Diff line number Diff line Loading @@ -386,14 +386,8 @@ public class SplitTransitionTests extends ShellTestCase { // Make sure it cleans-up if recents doesn't restore WindowContainerTransaction commitWCT = new WindowContainerTransaction(); if (Flags.enableRecentsBookendTransition()) { mStageCoordinator.onRecentsInSplitAnimationFinishing(false /* returnToApp */, commitWCT, mock(SurfaceControl.Transaction.class)); } else { mStageCoordinator.onRecentsInSplitAnimationFinishing( mStageCoordinator.wctIsReorderingSplitToTop(commitWCT), commitWCT, mock(SurfaceControl.Transaction.class)); } assertFalse(mStageCoordinator.isSplitScreenVisible()); } Loading Loading @@ -457,14 +451,8 @@ public class SplitTransitionTests extends ShellTestCase { // simulate the restoreWCT being applied: mMainStage.onTaskAppeared(mMainChild, mock(SurfaceControl.class)); mSideStage.onTaskAppeared(mSideChild, mock(SurfaceControl.class)); if (Flags.enableRecentsBookendTransition()) { mStageCoordinator.onRecentsInSplitAnimationFinishing(true /* returnToApp */, restoreWCT, mock(SurfaceControl.Transaction.class)); } else { mStageCoordinator.onRecentsInSplitAnimationFinishing( mStageCoordinator.wctIsReorderingSplitToTop(restoreWCT), restoreWCT, mock(SurfaceControl.Transaction.class)); } assertTrue(mStageCoordinator.isSplitScreenVisible()); } Loading services/core/java/com/android/server/wm/WindowOrganizerController.java +17 −30 Original line number Diff line number Diff line Loading @@ -706,7 +706,6 @@ class WindowOrganizerController extends IWindowOrganizerController.Stub if ((entry.getValue().getChangeMask() & WindowContainerTransaction.Change.CHANGE_FORCE_NO_PIP) != 0) { if (com.android.wm.shell.Flags.enableRecentsBookendTransition()) { // If we are using a bookend transition, then the transition that we need // to disable pip on finish is the original transient transition, not the // bookend transition Loading @@ -718,12 +717,6 @@ class WindowOrganizerController extends IWindowOrganizerController.Stub ProtoLog.v(WmProtoLogGroups.WM_DEBUG_WINDOW_TRANSITIONS, "Set do-not-pip: no task"); } } else { // Disable entering pip (eg. when recents pretends to finish itself) if (transition != null) { transition.setCanPipOnFinish(false /* canPipOnFinish */); } } } // A bit hacky, but we need to detect "remove PiP" so that we can "wrap" the // setWindowingMode call in force-hidden. Loading Loading @@ -1505,10 +1498,6 @@ class WindowOrganizerController extends IWindowOrganizerController.Stub break; } case HIERARCHY_OP_TYPE_RESTORE_TRANSIENT_ORDER: { if (!com.android.wm.shell.Flags.enableRecentsBookendTransition()) { // Only allow restoring transient order when finishing a transition if (!chain.isFinishing()) break; } // Validate the container final WindowContainer container = WindowContainer.fromBinder(hop.getContainer()); if (container == null) { Loading Loading @@ -1541,7 +1530,6 @@ class WindowOrganizerController extends IWindowOrganizerController.Stub final TaskDisplayArea taskDisplayArea = thisTask.getTaskDisplayArea(); taskDisplayArea.moveRootTaskBehindRootTask(thisTask.getRootTask(), restoreAt); 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 Loading @@ -1551,7 +1539,6 @@ class WindowOrganizerController extends IWindowOrganizerController.Stub collectingTransition.updateChangesForRestoreTransientHideTasks( transientLaunchTransition); } } effects |= TRANSACT_EFFECTS_LIFECYCLE; break; Loading Loading
libs/WindowManager/Shell/aconfig/multitasking.aconfig +0 −10 Original line number Diff line number Diff line Loading @@ -117,16 +117,6 @@ flag { } } flag { name: "enable_recents_bookend_transition" namespace: "multitasking" description: "Use a finish-transition to clean up recents instead of the finish-WCT" bug: "346588978" metadata { purpose: PURPOSE_BUGFIX } } flag { name: "enable_bubble_to_fullscreen" namespace: "multitasking" Loading
libs/WindowManager/Shell/src/com/android/wm/shell/recents/RecentsTransitionHandler.java +46 −77 Original line number Diff line number Diff line Loading @@ -284,10 +284,7 @@ public class RecentsTransitionHandler implements Transitions.TransitionHandler, break; } } final int transitionType = Flags.enableRecentsBookendTransition() ? TRANSIT_START_RECENTS_TRANSITION : TRANSIT_TO_FRONT; final IBinder transition = mTransitions.startTransition(transitionType, final IBinder transition = mTransitions.startTransition(TRANSIT_START_RECENTS_TRANSITION, wct, mixer == null ? this : mixer); if (mixer != null) { setTransitionForMixer.accept(transition); Loading Loading @@ -474,8 +471,7 @@ public class RecentsTransitionHandler implements Transitions.TransitionHandler, // next called. private Pair<int[], TaskSnapshot[]> mPendingPauseSnapshotsForCancel; // Used to track a pending finish transition, this is only non-null if // enableRecentsBookendTransition() is enabled // Used to track a pending finish transition private IBinder mPendingFinishTransition; private IResultReceiver mPendingRunnerFinishCb; // This stores the pending finish transaction to merge with the actual finish transaction Loading Loading @@ -1067,7 +1063,6 @@ public class RecentsTransitionHandler implements Transitions.TransitionHandler, return; } if (Flags.enableRecentsBookendTransition()) { if (info.getType() == TRANSIT_END_RECENTS_TRANSITION) { // This is a pending finish, so merge the end transition to trigger completing // the cleanup of the recents transition Loading @@ -1086,7 +1081,6 @@ public class RecentsTransitionHandler implements Transitions.TransitionHandler, onFinishInner(null /* wct */); return; } } if (info.getType() == TRANSIT_SLEEP) { ProtoLog.v(ShellProtoLogGroup.WM_SHELL_RECENTS_TRANSITION, Loading Loading @@ -1557,8 +1551,7 @@ public class RecentsTransitionHandler implements Transitions.TransitionHandler, return; } if (mFinishCB == null || (Flags.enableRecentsBookendTransition() && mPendingFinishTransition != null)) { if (mFinishCB == null || mPendingFinishTransition != null) { Slog.e(TAG, "Duplicate call to finish"); if (runnerFinishCb != null) { try { Loading @@ -1579,21 +1572,6 @@ public class RecentsTransitionHandler implements Transitions.TransitionHandler, && !mWillFinishToHome && mPausingTasks != null && mState == STATE_NORMAL; 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)) { mHomeTransitionObserver.notifyHomeVisibilityChanged(true); } else if (!toHome && mState == STATE_NEW_TASK && allAppsAreTranslucent(mOpeningTasks)) { // We are opening a translucent app. Launcher is still visible so we do nothing. } else if (!toHome) { // For some transitions, we may have notified home activity that it became // visible. We need to notify the observer that we are no longer going home. mHomeTransitionObserver.notifyHomeVisibilityChanged(false); } } ProtoLog.v(ShellProtoLogGroup.WM_SHELL_RECENTS_TRANSITION, "[%d] RecentsController.finishInner: toHome=%b userLeave=%b " + "willFinishToHome=%b state=%d hasPausingTasks=%b reason=%s", Loading Loading @@ -1747,7 +1725,6 @@ public class RecentsTransitionHandler implements Transitions.TransitionHandler, // We need to clear the WCT to send finishWCT=null for Recents. wct.clear(); if (Flags.enableRecentsBookendTransition()) { // Notify the mixers of the pending finish for (int i = 0; i < mMixers.size(); ++i) { mMixers.get(i).handleFinishRecents(returningToApp, wct, t); Loading @@ -1763,14 +1740,12 @@ public class RecentsTransitionHandler implements Transitions.TransitionHandler, } } } } // Notify the mixers of the pending finish for (int i = 0; i < mMixers.size(); ++i) { mMixers.get(i).handleFinishRecents(returningToApp, wct, t); } if (Flags.enableRecentsBookendTransition()) { if (!wct.isEmpty()) { if (requiresBookendTransition) { ProtoLog.v(ShellProtoLogGroup.WM_SHELL_RECENTS_TRANSITION, Loading @@ -1795,11 +1770,6 @@ public class RecentsTransitionHandler implements Transitions.TransitionHandler, mPendingFinishTransaction = t; onFinishInner(null /* wct */); } } else { mPendingRunnerFinishCb = runnerFinishCb; mPendingFinishTransaction = t; onFinishInner(wct); } } /** Loading Loading @@ -1931,7 +1901,6 @@ 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.enableRecentsBookendTransition() is enabled. */ private class PendingFinishTransitionHandler implements Transitions.TransitionHandler { @Override Loading
libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/recents/RecentsTransitionHandlerTest.java +1 −5 Original line number Diff line number Diff line Loading @@ -30,7 +30,6 @@ import static com.android.window.flags.Flags.FLAG_ENABLE_DESKTOP_RECENTS_TRANSIT import static com.android.window.flags.Flags.FLAG_ENABLE_DESKTOP_SPLITSCREEN_TRANSITION_BUGFIX; import static com.android.window.flags.Flags.FLAG_ENABLE_MULTIPLE_DESKTOPS_BACKEND; import static com.android.wm.shell.Flags.FLAG_ENABLE_PIP2; import static com.android.wm.shell.Flags.FLAG_ENABLE_RECENTS_BOOKEND_TRANSITION; import static com.android.wm.shell.Flags.FLAG_FIX_BUBBLES_TO_RECENTS; import static com.android.wm.shell.recents.RecentsTransitionStateListener.TRANSITION_STATE_ANIMATING; import static com.android.wm.shell.recents.RecentsTransitionStateListener.TRANSITION_STATE_NOT_RUNNING; Loading Loading @@ -396,7 +395,6 @@ public class RecentsTransitionHandlerTest extends ShellTestCase { } @Test @EnableFlags(FLAG_ENABLE_RECENTS_BOOKEND_TRANSITION) public void testMerge_consumeBookendTransition() throws Exception { // Start and finish the transition final IRecentsAnimationRunner animationRunner = mock(IRecentsAnimationRunner.class); Loading Loading @@ -428,7 +426,6 @@ public class RecentsTransitionHandlerTest extends ShellTestCase { } @Test @EnableFlags(FLAG_ENABLE_RECENTS_BOOKEND_TRANSITION) public void testMerge_pendingBookendTransition_mergesTransition() throws Exception { // Start and finish the transition final IRecentsAnimationRunner animationRunner = mock(IRecentsAnimationRunner.class); Loading Loading @@ -575,7 +572,6 @@ public class RecentsTransitionHandlerTest extends ShellTestCase { } @Test @EnableFlags(FLAG_ENABLE_RECENTS_BOOKEND_TRANSITION) public void testMerge_cancelToHome_onTransitSleep() throws Exception { TransitionInfo mergeTransitionInfo = new TransitionInfoBuilder(TRANSIT_SLEEP) .build(); Loading @@ -583,7 +579,7 @@ public class RecentsTransitionHandlerTest extends ShellTestCase { } @Test @EnableFlags({FLAG_ENABLE_RECENTS_BOOKEND_TRANSITION, FLAG_ENABLE_PIP2}) @EnableFlags(FLAG_ENABLE_PIP2) public void testMerge_cancelToHome_onTransitRemovePip() throws Exception { TransitionInfo mergeTransitionInfo = new TransitionInfoBuilder(TRANSIT_REMOVE_PIP) .build(); Loading
libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/splitscreen/SplitTransitionTests.java +4 −16 Original line number Diff line number Diff line Loading @@ -386,14 +386,8 @@ public class SplitTransitionTests extends ShellTestCase { // Make sure it cleans-up if recents doesn't restore WindowContainerTransaction commitWCT = new WindowContainerTransaction(); if (Flags.enableRecentsBookendTransition()) { mStageCoordinator.onRecentsInSplitAnimationFinishing(false /* returnToApp */, commitWCT, mock(SurfaceControl.Transaction.class)); } else { mStageCoordinator.onRecentsInSplitAnimationFinishing( mStageCoordinator.wctIsReorderingSplitToTop(commitWCT), commitWCT, mock(SurfaceControl.Transaction.class)); } assertFalse(mStageCoordinator.isSplitScreenVisible()); } Loading Loading @@ -457,14 +451,8 @@ public class SplitTransitionTests extends ShellTestCase { // simulate the restoreWCT being applied: mMainStage.onTaskAppeared(mMainChild, mock(SurfaceControl.class)); mSideStage.onTaskAppeared(mSideChild, mock(SurfaceControl.class)); if (Flags.enableRecentsBookendTransition()) { mStageCoordinator.onRecentsInSplitAnimationFinishing(true /* returnToApp */, restoreWCT, mock(SurfaceControl.Transaction.class)); } else { mStageCoordinator.onRecentsInSplitAnimationFinishing( mStageCoordinator.wctIsReorderingSplitToTop(restoreWCT), restoreWCT, mock(SurfaceControl.Transaction.class)); } assertTrue(mStageCoordinator.isSplitScreenVisible()); } Loading
services/core/java/com/android/server/wm/WindowOrganizerController.java +17 −30 Original line number Diff line number Diff line Loading @@ -706,7 +706,6 @@ class WindowOrganizerController extends IWindowOrganizerController.Stub if ((entry.getValue().getChangeMask() & WindowContainerTransaction.Change.CHANGE_FORCE_NO_PIP) != 0) { if (com.android.wm.shell.Flags.enableRecentsBookendTransition()) { // If we are using a bookend transition, then the transition that we need // to disable pip on finish is the original transient transition, not the // bookend transition Loading @@ -718,12 +717,6 @@ class WindowOrganizerController extends IWindowOrganizerController.Stub ProtoLog.v(WmProtoLogGroups.WM_DEBUG_WINDOW_TRANSITIONS, "Set do-not-pip: no task"); } } else { // Disable entering pip (eg. when recents pretends to finish itself) if (transition != null) { transition.setCanPipOnFinish(false /* canPipOnFinish */); } } } // A bit hacky, but we need to detect "remove PiP" so that we can "wrap" the // setWindowingMode call in force-hidden. Loading Loading @@ -1505,10 +1498,6 @@ class WindowOrganizerController extends IWindowOrganizerController.Stub break; } case HIERARCHY_OP_TYPE_RESTORE_TRANSIENT_ORDER: { if (!com.android.wm.shell.Flags.enableRecentsBookendTransition()) { // Only allow restoring transient order when finishing a transition if (!chain.isFinishing()) break; } // Validate the container final WindowContainer container = WindowContainer.fromBinder(hop.getContainer()); if (container == null) { Loading Loading @@ -1541,7 +1530,6 @@ class WindowOrganizerController extends IWindowOrganizerController.Stub final TaskDisplayArea taskDisplayArea = thisTask.getTaskDisplayArea(); taskDisplayArea.moveRootTaskBehindRootTask(thisTask.getRootTask(), restoreAt); 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 Loading @@ -1551,7 +1539,6 @@ class WindowOrganizerController extends IWindowOrganizerController.Stub collectingTransition.updateChangesForRestoreTransientHideTasks( transientLaunchTransition); } } effects |= TRANSACT_EFFECTS_LIFECYCLE; break; Loading