Loading libs/WindowManager/Shell/src/com/android/wm/shell/desktopmode/DesktopTasksController.kt +6 −0 Original line number Diff line number Diff line Loading @@ -449,6 +449,11 @@ class DesktopTasksController( return false } // Secondary displays are always desktop-first if (displayId != DEFAULT_DISPLAY) { return true } val tdaInfo = rootTaskDisplayAreaOrganizer.getDisplayAreaInfo(displayId) // A non-organized display (e.g., non-trusted virtual displays used in CTS) doesn't have // TDA. Loading Loading @@ -1140,6 +1145,7 @@ class DesktopTasksController( } val t = if (remoteTransition == null) { logV("startLaunchTransition -- no remoteTransition -- wct = $launchTransaction") desktopMixedTransitionHandler.startLaunchTransition( transitionType = transitionType, wct = launchTransaction, Loading libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/desktopmode/DesktopTasksControllerTest.kt +19 −0 Original line number Diff line number Diff line Loading @@ -4286,6 +4286,25 @@ class DesktopTasksControllerTest(flags: FlagsParameterization) : ShellTestCase() verify(desksOrganizer).moveTaskToDesk(wct, deskId, fullscreenTask) } @Test @EnableFlags( Flags.FLAG_ENABLE_DESKTOP_WINDOWING_WALLPAPER_ACTIVITY, Flags.FLAG_ENABLE_MULTIPLE_DESKTOPS_BACKEND, ) fun handleRequest_fullscreenTask_noInDesk_enforceDesktop_secondaryDisplay_movesToDesk() { val deskId = 5 taskRepository.addDesk(displayId = SECONDARY_DISPLAY_ID, deskId = deskId) taskRepository.setDeskInactive(deskId) whenever(desktopWallpaperActivityTokenProvider.getToken()).thenReturn(null) whenever(DesktopModeStatus.enterDesktopByDefaultOnFreeformDisplay(context)).thenReturn(true) val fullscreenTask = createFullscreenTask(displayId = SECONDARY_DISPLAY_ID) val wct = controller.handleRequest(Binder(), createTransition(fullscreenTask)) assertNotNull(wct, "should handle request") verify(desksOrganizer).moveTaskToDesk(wct, deskId, fullscreenTask) } @Test fun handleRequest_fullscreenTask_notInDesk_enforceDesktop_fullscreenDisplay_returnNull() { taskRepository.setDeskInactive(deskId = 0) Loading Loading
libs/WindowManager/Shell/src/com/android/wm/shell/desktopmode/DesktopTasksController.kt +6 −0 Original line number Diff line number Diff line Loading @@ -449,6 +449,11 @@ class DesktopTasksController( return false } // Secondary displays are always desktop-first if (displayId != DEFAULT_DISPLAY) { return true } val tdaInfo = rootTaskDisplayAreaOrganizer.getDisplayAreaInfo(displayId) // A non-organized display (e.g., non-trusted virtual displays used in CTS) doesn't have // TDA. Loading Loading @@ -1140,6 +1145,7 @@ class DesktopTasksController( } val t = if (remoteTransition == null) { logV("startLaunchTransition -- no remoteTransition -- wct = $launchTransaction") desktopMixedTransitionHandler.startLaunchTransition( transitionType = transitionType, wct = launchTransaction, Loading
libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/desktopmode/DesktopTasksControllerTest.kt +19 −0 Original line number Diff line number Diff line Loading @@ -4286,6 +4286,25 @@ class DesktopTasksControllerTest(flags: FlagsParameterization) : ShellTestCase() verify(desksOrganizer).moveTaskToDesk(wct, deskId, fullscreenTask) } @Test @EnableFlags( Flags.FLAG_ENABLE_DESKTOP_WINDOWING_WALLPAPER_ACTIVITY, Flags.FLAG_ENABLE_MULTIPLE_DESKTOPS_BACKEND, ) fun handleRequest_fullscreenTask_noInDesk_enforceDesktop_secondaryDisplay_movesToDesk() { val deskId = 5 taskRepository.addDesk(displayId = SECONDARY_DISPLAY_ID, deskId = deskId) taskRepository.setDeskInactive(deskId) whenever(desktopWallpaperActivityTokenProvider.getToken()).thenReturn(null) whenever(DesktopModeStatus.enterDesktopByDefaultOnFreeformDisplay(context)).thenReturn(true) val fullscreenTask = createFullscreenTask(displayId = SECONDARY_DISPLAY_ID) val wct = controller.handleRequest(Binder(), createTransition(fullscreenTask)) assertNotNull(wct, "should handle request") verify(desksOrganizer).moveTaskToDesk(wct, deskId, fullscreenTask) } @Test fun handleRequest_fullscreenTask_notInDesk_enforceDesktop_fullscreenDisplay_returnNull() { taskRepository.setDeskInactive(deskId = 0) Loading