Loading libs/WindowManager/Shell/src/com/android/wm/shell/desktopmode/DesktopTasksController.kt +10 −4 Original line number Diff line number Diff line Loading @@ -983,6 +983,7 @@ class DesktopTasksController( ProtoLog.v(WM_SHELL_DESKTOP_MODE, "DesktopTasksController: skip keyguard is locked") return null } val wct = WindowContainerTransaction() if (!isDesktopModeShowing(task.displayId)) { ProtoLog.d( WM_SHELL_DESKTOP_MODE, Loading @@ -990,12 +991,17 @@ class DesktopTasksController( " taskId=%d", task.taskId ) return WindowContainerTransaction().also { wct -> // We are outside of desktop mode and already existing desktop task is being launched. // We should make this task go to fullscreen instead of freeform. Note that this means // any re-launch of a freeform window outside of desktop will be in fullscreen. if (desktopModeTaskRepository.isActiveTask(task.taskId)) { addMoveToFullscreenChanges(wct, task) return wct } bringDesktopAppsToFrontBeforeShowingNewTask(task.displayId, wct, task.taskId) wct.reorder(task.token, true) return wct } } val wct = WindowContainerTransaction() if (useDesktopOverrideDensity()) { wct.setDensityDpi(task.token, DESKTOP_DENSITY_OVERRIDE) } Loading libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/desktopmode/DesktopTasksControllerTest.kt +16 −0 Original line number Diff line number Diff line Loading @@ -1325,6 +1325,22 @@ class DesktopTasksControllerTest : ShellTestCase() { wct!!.assertReorderAt(0, freeformTasks[0], toTop = false) // Reorder to the bottom } @Test fun handleRequest_freeformTask_relaunchActiveTask_taskBecomesUndefined() { assumeTrue(ENABLE_SHELL_TRANSITIONS) val freeformTask = setUpFreeformTask() markTaskHidden(freeformTask) val wct = controller.handleRequest(Binder(), createTransition(freeformTask)) // Should become undefined as the TDA is set to fullscreen. It will inherit from the TDA. assertNotNull(wct, "should handle request") assertThat(wct.changes[freeformTask.token.asBinder()]?.windowingMode) .isEqualTo(WINDOWING_MODE_UNDEFINED) } @Test @DisableFlags(Flags.FLAG_ENABLE_DESKTOP_WINDOWING_WALLPAPER_ACTIVITY) fun handleRequest_freeformTask_desktopWallpaperDisabled_freeformNotVisible_reorderedToTop() { Loading Loading
libs/WindowManager/Shell/src/com/android/wm/shell/desktopmode/DesktopTasksController.kt +10 −4 Original line number Diff line number Diff line Loading @@ -983,6 +983,7 @@ class DesktopTasksController( ProtoLog.v(WM_SHELL_DESKTOP_MODE, "DesktopTasksController: skip keyguard is locked") return null } val wct = WindowContainerTransaction() if (!isDesktopModeShowing(task.displayId)) { ProtoLog.d( WM_SHELL_DESKTOP_MODE, Loading @@ -990,12 +991,17 @@ class DesktopTasksController( " taskId=%d", task.taskId ) return WindowContainerTransaction().also { wct -> // We are outside of desktop mode and already existing desktop task is being launched. // We should make this task go to fullscreen instead of freeform. Note that this means // any re-launch of a freeform window outside of desktop will be in fullscreen. if (desktopModeTaskRepository.isActiveTask(task.taskId)) { addMoveToFullscreenChanges(wct, task) return wct } bringDesktopAppsToFrontBeforeShowingNewTask(task.displayId, wct, task.taskId) wct.reorder(task.token, true) return wct } } val wct = WindowContainerTransaction() if (useDesktopOverrideDensity()) { wct.setDensityDpi(task.token, DESKTOP_DENSITY_OVERRIDE) } Loading
libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/desktopmode/DesktopTasksControllerTest.kt +16 −0 Original line number Diff line number Diff line Loading @@ -1325,6 +1325,22 @@ class DesktopTasksControllerTest : ShellTestCase() { wct!!.assertReorderAt(0, freeformTasks[0], toTop = false) // Reorder to the bottom } @Test fun handleRequest_freeformTask_relaunchActiveTask_taskBecomesUndefined() { assumeTrue(ENABLE_SHELL_TRANSITIONS) val freeformTask = setUpFreeformTask() markTaskHidden(freeformTask) val wct = controller.handleRequest(Binder(), createTransition(freeformTask)) // Should become undefined as the TDA is set to fullscreen. It will inherit from the TDA. assertNotNull(wct, "should handle request") assertThat(wct.changes[freeformTask.token.asBinder()]?.windowingMode) .isEqualTo(WINDOWING_MODE_UNDEFINED) } @Test @DisableFlags(Flags.FLAG_ENABLE_DESKTOP_WINDOWING_WALLPAPER_ACTIVITY) fun handleRequest_freeformTask_desktopWallpaperDisabled_freeformNotVisible_reorderedToTop() { Loading