Loading libs/WindowManager/Shell/src/com/android/wm/shell/recents/RecentsTransitionHandler.java +18 −3 Original line number Diff line number Diff line Loading @@ -817,9 +817,19 @@ public class RecentsTransitionHandler implements Transitions.TransitionHandler, // the pausing apps. t.setLayer(target.leash, layer); } else if (taskInfo != null && taskInfo.topActivityType == ACTIVITY_TYPE_HOME) { if (DesktopExperienceFlags .ENABLE_DESKTOP_SPLITSCREEN_TRANSITION_BUGFIX.isTrue()) { ProtoLog.v(ShellProtoLogGroup.WM_SHELL_RECENTS_TRANSITION, " hiding home taskId=%d", taskInfo.taskId); // Hide the Home task (Launcher) so that it doesn't cause a flicker by // appearing before the animation itself starts. // TODO: b/399160023 remove this when we stop using transition-type // checks in transition utils. t.hide(target.leash); } else { ProtoLog.v(ShellProtoLogGroup.WM_SHELL_RECENTS_TRANSITION, " not handling home taskId=%d", taskInfo.taskId); // do nothing } } else if (TransitionUtil.isOpeningType(change.getMode())) { ProtoLog.v(ShellProtoLogGroup.WM_SHELL_RECENTS_TRANSITION, " adding opening leaf taskId=%d", taskInfo.taskId); Loading Loading @@ -1873,6 +1883,11 @@ public class RecentsTransitionHandler implements Transitions.TransitionHandler, onFinishInner(null /* wct */); } }; @VisibleForTesting ArrayMap<SurfaceControl, SurfaceControl> getLeashMapForTesting() { return mLeashMap; } }; /** Utility class to track the state of a task as-seen by recents. */ Loading libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/recents/RecentsTransitionHandlerTest.java +23 −1 Original line number Diff line number Diff line Loading @@ -26,6 +26,7 @@ import static android.view.WindowManager.TRANSIT_TO_BACK; import static android.view.WindowManager.TRANSIT_TO_FRONT; import static com.android.window.flags.Flags.FLAG_ENABLE_DESKTOP_RECENTS_TRANSITIONS_CORNERS_BUGFIX; 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; Loading Loading @@ -263,6 +264,23 @@ public class RecentsTransitionHandlerTest extends ShellTestCase { assertThat(listener.getState()).isEqualTo(TRANSITION_STATE_ANIMATING); } @Test @EnableFlags(FLAG_ENABLE_DESKTOP_SPLITSCREEN_TRANSITION_BUGFIX) public void testStartAnimation_hidesHomeTask() { final IBinder transition = startRecentsTransition(/* synthetic= */ false); RecentsTransitionHandler.RecentsController controller = mRecentsTransitionHandler.findController(transition); SurfaceControl.Transaction startT = mock(SurfaceControl.Transaction.class); SurfaceControl homeLeash = new SurfaceControl(); mRecentsTransitionHandler.startAnimation( transition, createTransitionInfo(homeLeash), startT, new StubTransaction(), mock(Transitions.TransitionFinishCallback.class)); mMainExecutor.flushAll(); verify(startT).hide(controller.getLeashMapForTesting().get(homeLeash)); } @Test public void testFinishTransition_updatesStateListeners() { final TestTransitionStateListener listener = new TestTransitionStateListener(); Loading Loading @@ -640,6 +658,10 @@ public class RecentsTransitionHandlerTest extends ShellTestCase { } private TransitionInfo createTransitionInfo() { return createTransitionInfo(new SurfaceControl()); } private TransitionInfo createTransitionInfo(SurfaceControl homeLeash) { final ActivityManager.RunningTaskInfo homeTask = new TestRunningTaskInfoBuilder() .setTopActivityType(ACTIVITY_TYPE_HOME) .build(); Loading @@ -647,7 +669,7 @@ public class RecentsTransitionHandlerTest extends ShellTestCase { .setTopActivityType(ACTIVITY_TYPE_STANDARD) .build(); final TransitionInfo.Change homeChange = new TransitionInfo.Change( homeTask.token, new SurfaceControl()); homeTask.token, homeLeash); homeChange.setMode(TRANSIT_TO_FRONT); homeChange.setTaskInfo(homeTask); final TransitionInfo.Change appChange = new TransitionInfo.Change( Loading Loading
libs/WindowManager/Shell/src/com/android/wm/shell/recents/RecentsTransitionHandler.java +18 −3 Original line number Diff line number Diff line Loading @@ -817,9 +817,19 @@ public class RecentsTransitionHandler implements Transitions.TransitionHandler, // the pausing apps. t.setLayer(target.leash, layer); } else if (taskInfo != null && taskInfo.topActivityType == ACTIVITY_TYPE_HOME) { if (DesktopExperienceFlags .ENABLE_DESKTOP_SPLITSCREEN_TRANSITION_BUGFIX.isTrue()) { ProtoLog.v(ShellProtoLogGroup.WM_SHELL_RECENTS_TRANSITION, " hiding home taskId=%d", taskInfo.taskId); // Hide the Home task (Launcher) so that it doesn't cause a flicker by // appearing before the animation itself starts. // TODO: b/399160023 remove this when we stop using transition-type // checks in transition utils. t.hide(target.leash); } else { ProtoLog.v(ShellProtoLogGroup.WM_SHELL_RECENTS_TRANSITION, " not handling home taskId=%d", taskInfo.taskId); // do nothing } } else if (TransitionUtil.isOpeningType(change.getMode())) { ProtoLog.v(ShellProtoLogGroup.WM_SHELL_RECENTS_TRANSITION, " adding opening leaf taskId=%d", taskInfo.taskId); Loading Loading @@ -1873,6 +1883,11 @@ public class RecentsTransitionHandler implements Transitions.TransitionHandler, onFinishInner(null /* wct */); } }; @VisibleForTesting ArrayMap<SurfaceControl, SurfaceControl> getLeashMapForTesting() { return mLeashMap; } }; /** Utility class to track the state of a task as-seen by recents. */ Loading
libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/recents/RecentsTransitionHandlerTest.java +23 −1 Original line number Diff line number Diff line Loading @@ -26,6 +26,7 @@ import static android.view.WindowManager.TRANSIT_TO_BACK; import static android.view.WindowManager.TRANSIT_TO_FRONT; import static com.android.window.flags.Flags.FLAG_ENABLE_DESKTOP_RECENTS_TRANSITIONS_CORNERS_BUGFIX; 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; Loading Loading @@ -263,6 +264,23 @@ public class RecentsTransitionHandlerTest extends ShellTestCase { assertThat(listener.getState()).isEqualTo(TRANSITION_STATE_ANIMATING); } @Test @EnableFlags(FLAG_ENABLE_DESKTOP_SPLITSCREEN_TRANSITION_BUGFIX) public void testStartAnimation_hidesHomeTask() { final IBinder transition = startRecentsTransition(/* synthetic= */ false); RecentsTransitionHandler.RecentsController controller = mRecentsTransitionHandler.findController(transition); SurfaceControl.Transaction startT = mock(SurfaceControl.Transaction.class); SurfaceControl homeLeash = new SurfaceControl(); mRecentsTransitionHandler.startAnimation( transition, createTransitionInfo(homeLeash), startT, new StubTransaction(), mock(Transitions.TransitionFinishCallback.class)); mMainExecutor.flushAll(); verify(startT).hide(controller.getLeashMapForTesting().get(homeLeash)); } @Test public void testFinishTransition_updatesStateListeners() { final TestTransitionStateListener listener = new TestTransitionStateListener(); Loading Loading @@ -640,6 +658,10 @@ public class RecentsTransitionHandlerTest extends ShellTestCase { } private TransitionInfo createTransitionInfo() { return createTransitionInfo(new SurfaceControl()); } private TransitionInfo createTransitionInfo(SurfaceControl homeLeash) { final ActivityManager.RunningTaskInfo homeTask = new TestRunningTaskInfoBuilder() .setTopActivityType(ACTIVITY_TYPE_HOME) .build(); Loading @@ -647,7 +669,7 @@ public class RecentsTransitionHandlerTest extends ShellTestCase { .setTopActivityType(ACTIVITY_TYPE_STANDARD) .build(); final TransitionInfo.Change homeChange = new TransitionInfo.Change( homeTask.token, new SurfaceControl()); homeTask.token, homeLeash); homeChange.setMode(TRANSIT_TO_FRONT); homeChange.setTaskInfo(homeTask); final TransitionInfo.Change appChange = new TransitionInfo.Change( Loading