Loading libs/WindowManager/Shell/src/com/android/wm/shell/desktopmode/DesktopTasksController.kt +4 −0 Original line number Diff line number Diff line Loading @@ -3085,6 +3085,10 @@ class DesktopTasksController( } if (DesktopExperienceFlags.ENABLE_MULTIPLE_DESKTOPS_BACKEND.isTrue) { wct.reparent(taskInfo.token, tdaInfo.token, /* onTop= */ true) } else if (com.android.launcher3.Flags.enableAltTabKqsFlatenning()) { // Until multiple desktops is enabled, we still want to reorder the task to top so that // if the task is not on top we can still switch to it using Alt+Tab. wct.reorder(taskInfo.token, /* onTop= */ true) } val deskId = Loading libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/desktopmode/DesktopTasksControllerTest.kt +31 −0 Original line number Diff line number Diff line Loading @@ -2510,6 +2510,37 @@ class DesktopTasksControllerTest(flags: FlagsParameterization) : ShellTestCase() ) } @Test @EnableFlags(com.android.launcher3.Flags.FLAG_ENABLE_ALT_TAB_KQS_FLATENNING) @DisableFlags(Flags.FLAG_ENABLE_MULTIPLE_DESKTOPS_BACKEND) fun moveToFullscreen_enforceDesktopWithMultipleDesktopDisabled_taskReorderToTop() { desktopState.enterDesktopByDefaultOnFreeformDisplay = true val transitionHandlerArgCaptor = argumentCaptor<TransitionHandler>() whenever(transitions.startTransition(anyInt(), any(), transitionHandlerArgCaptor.capture())) .thenReturn(Binder()) val task = setUpFullscreenTask() assertNotNull(rootTaskDisplayAreaOrganizer.getDisplayAreaInfo(DEFAULT_DISPLAY)) .configuration .windowConfiguration .windowingMode = WINDOWING_MODE_FREEFORM controller.moveToFullscreen( task.taskId, transitionSource = UNKNOWN, remoteTransition = RemoteTransition(spy(TestRemoteTransition())), ) val wct = getLatestWct(type = TRANSIT_TO_FRONT, handlerClass = OneShotRemoteHandler::class.java) assertThat(wct.changes[task.token.asBinder()]?.windowingMode) .isEqualTo(WINDOWING_MODE_FULLSCREEN) wct.assertReorderAt(index = 0, task) verify(desktopModeEnterExitTransitionListener, never()) .onEnterDesktopModeTransitionStarted(anyInt()) assertIs<OneShotRemoteHandler>(transitionHandlerArgCaptor.firstValue) } @Test @EnableFlags(com.android.launcher3.Flags.FLAG_ENABLE_ALT_TAB_KQS_FLATENNING) fun moveToFullscreen_fullscreenTaskWithRemoteTransition_transitToFrontUsesRemoteTransition() { Loading Loading
libs/WindowManager/Shell/src/com/android/wm/shell/desktopmode/DesktopTasksController.kt +4 −0 Original line number Diff line number Diff line Loading @@ -3085,6 +3085,10 @@ class DesktopTasksController( } if (DesktopExperienceFlags.ENABLE_MULTIPLE_DESKTOPS_BACKEND.isTrue) { wct.reparent(taskInfo.token, tdaInfo.token, /* onTop= */ true) } else if (com.android.launcher3.Flags.enableAltTabKqsFlatenning()) { // Until multiple desktops is enabled, we still want to reorder the task to top so that // if the task is not on top we can still switch to it using Alt+Tab. wct.reorder(taskInfo.token, /* onTop= */ true) } val deskId = Loading
libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/desktopmode/DesktopTasksControllerTest.kt +31 −0 Original line number Diff line number Diff line Loading @@ -2510,6 +2510,37 @@ class DesktopTasksControllerTest(flags: FlagsParameterization) : ShellTestCase() ) } @Test @EnableFlags(com.android.launcher3.Flags.FLAG_ENABLE_ALT_TAB_KQS_FLATENNING) @DisableFlags(Flags.FLAG_ENABLE_MULTIPLE_DESKTOPS_BACKEND) fun moveToFullscreen_enforceDesktopWithMultipleDesktopDisabled_taskReorderToTop() { desktopState.enterDesktopByDefaultOnFreeformDisplay = true val transitionHandlerArgCaptor = argumentCaptor<TransitionHandler>() whenever(transitions.startTransition(anyInt(), any(), transitionHandlerArgCaptor.capture())) .thenReturn(Binder()) val task = setUpFullscreenTask() assertNotNull(rootTaskDisplayAreaOrganizer.getDisplayAreaInfo(DEFAULT_DISPLAY)) .configuration .windowConfiguration .windowingMode = WINDOWING_MODE_FREEFORM controller.moveToFullscreen( task.taskId, transitionSource = UNKNOWN, remoteTransition = RemoteTransition(spy(TestRemoteTransition())), ) val wct = getLatestWct(type = TRANSIT_TO_FRONT, handlerClass = OneShotRemoteHandler::class.java) assertThat(wct.changes[task.token.asBinder()]?.windowingMode) .isEqualTo(WINDOWING_MODE_FULLSCREEN) wct.assertReorderAt(index = 0, task) verify(desktopModeEnterExitTransitionListener, never()) .onEnterDesktopModeTransitionStarted(anyInt()) assertIs<OneShotRemoteHandler>(transitionHandlerArgCaptor.firstValue) } @Test @EnableFlags(com.android.launcher3.Flags.FLAG_ENABLE_ALT_TAB_KQS_FLATENNING) fun moveToFullscreen_fullscreenTaskWithRemoteTransition_transitToFrontUsesRemoteTransition() { Loading