Loading libs/WindowManager/Shell/src/com/android/wm/shell/desktopmode/DesktopTasksController.kt +9 −6 Original line number Diff line number Diff line Loading @@ -764,6 +764,8 @@ class DesktopTasksController( newTaskIdInFront ?: "null" ) // Currently, we only handle the desktop on the default display really. if (displayId == DEFAULT_DISPLAY) { if (Flags.enableDesktopWindowingWallpaperActivity()) { // Add translucent wallpaper activity to show the wallpaper underneath addWallpaperActivity(wct) Loading @@ -771,6 +773,7 @@ class DesktopTasksController( // Move home to front moveHomeTask(wct, toTop = true) } } val nonMinimizedTasksOrderedFrontToBack = desktopModeTaskRepository.getActiveNonMinimizedTasksOrderedFrontToBack(displayId) Loading libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/desktopmode/DesktopTasksControllerTest.kt +33 −0 Original line number Diff line number Diff line Loading @@ -310,6 +310,23 @@ class DesktopTasksControllerTest : ShellTestCase() { wct.assertReorderAt(index = 2, task2) } @Test @EnableFlags(Flags.FLAG_ENABLE_DESKTOP_WINDOWING_WALLPAPER_ACTIVITY) fun showDesktopApps_onSecondaryDisplay_desktopWallpaperEnabled_shouldNotShowWallpaper() { val task1 = setUpFreeformTask(SECOND_DISPLAY) val task2 = setUpFreeformTask(SECOND_DISPLAY) markTaskHidden(task1) markTaskHidden(task2) controller.showDesktopApps(SECOND_DISPLAY, RemoteTransition(TestRemoteTransition())) val wct = getLatestWct(type = TRANSIT_TO_FRONT, handlerClass = OneShotRemoteHandler::class.java) assertThat(wct.hierarchyOps).hasSize(2) // Expect order to be from bottom: task1, task2 (no wallpaper intent) wct.assertReorderAt(index = 0, task1) wct.assertReorderAt(index = 1, task2) } @Test @DisableFlags(Flags.FLAG_ENABLE_DESKTOP_WINDOWING_WALLPAPER_ACTIVITY) fun showDesktopApps_appsAlreadyVisible_bringsToFront_desktopWallpaperDisabled() { Loading @@ -329,6 +346,22 @@ class DesktopTasksControllerTest : ShellTestCase() { wct.assertReorderAt(index = 2, task2) } @Test @DisableFlags(Flags.FLAG_ENABLE_DESKTOP_WINDOWING_WALLPAPER_ACTIVITY) fun showDesktopApps_onSecondaryDisplay_desktopWallpaperDisabled_shouldNotMoveLauncher() { val task1 = setUpFreeformTask(SECOND_DISPLAY) val task2 = setUpFreeformTask(SECOND_DISPLAY) markTaskHidden(task1) markTaskHidden(task2) controller.showDesktopApps(SECOND_DISPLAY, RemoteTransition(TestRemoteTransition())) val wct = getLatestWct(type = TRANSIT_TO_FRONT, handlerClass = OneShotRemoteHandler::class.java) assertThat(wct.hierarchyOps).hasSize(2) wct.assertReorderAt(index = 0, task1) wct.assertReorderAt(index = 1, task2) } @Test @EnableFlags(Flags.FLAG_ENABLE_DESKTOP_WINDOWING_WALLPAPER_ACTIVITY) fun showDesktopApps_appsAlreadyVisible_bringsToFront_desktopWallpaperEnabled() { Loading Loading
libs/WindowManager/Shell/src/com/android/wm/shell/desktopmode/DesktopTasksController.kt +9 −6 Original line number Diff line number Diff line Loading @@ -764,6 +764,8 @@ class DesktopTasksController( newTaskIdInFront ?: "null" ) // Currently, we only handle the desktop on the default display really. if (displayId == DEFAULT_DISPLAY) { if (Flags.enableDesktopWindowingWallpaperActivity()) { // Add translucent wallpaper activity to show the wallpaper underneath addWallpaperActivity(wct) Loading @@ -771,6 +773,7 @@ class DesktopTasksController( // Move home to front moveHomeTask(wct, toTop = true) } } val nonMinimizedTasksOrderedFrontToBack = desktopModeTaskRepository.getActiveNonMinimizedTasksOrderedFrontToBack(displayId) Loading
libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/desktopmode/DesktopTasksControllerTest.kt +33 −0 Original line number Diff line number Diff line Loading @@ -310,6 +310,23 @@ class DesktopTasksControllerTest : ShellTestCase() { wct.assertReorderAt(index = 2, task2) } @Test @EnableFlags(Flags.FLAG_ENABLE_DESKTOP_WINDOWING_WALLPAPER_ACTIVITY) fun showDesktopApps_onSecondaryDisplay_desktopWallpaperEnabled_shouldNotShowWallpaper() { val task1 = setUpFreeformTask(SECOND_DISPLAY) val task2 = setUpFreeformTask(SECOND_DISPLAY) markTaskHidden(task1) markTaskHidden(task2) controller.showDesktopApps(SECOND_DISPLAY, RemoteTransition(TestRemoteTransition())) val wct = getLatestWct(type = TRANSIT_TO_FRONT, handlerClass = OneShotRemoteHandler::class.java) assertThat(wct.hierarchyOps).hasSize(2) // Expect order to be from bottom: task1, task2 (no wallpaper intent) wct.assertReorderAt(index = 0, task1) wct.assertReorderAt(index = 1, task2) } @Test @DisableFlags(Flags.FLAG_ENABLE_DESKTOP_WINDOWING_WALLPAPER_ACTIVITY) fun showDesktopApps_appsAlreadyVisible_bringsToFront_desktopWallpaperDisabled() { Loading @@ -329,6 +346,22 @@ class DesktopTasksControllerTest : ShellTestCase() { wct.assertReorderAt(index = 2, task2) } @Test @DisableFlags(Flags.FLAG_ENABLE_DESKTOP_WINDOWING_WALLPAPER_ACTIVITY) fun showDesktopApps_onSecondaryDisplay_desktopWallpaperDisabled_shouldNotMoveLauncher() { val task1 = setUpFreeformTask(SECOND_DISPLAY) val task2 = setUpFreeformTask(SECOND_DISPLAY) markTaskHidden(task1) markTaskHidden(task2) controller.showDesktopApps(SECOND_DISPLAY, RemoteTransition(TestRemoteTransition())) val wct = getLatestWct(type = TRANSIT_TO_FRONT, handlerClass = OneShotRemoteHandler::class.java) assertThat(wct.hierarchyOps).hasSize(2) wct.assertReorderAt(index = 0, task1) wct.assertReorderAt(index = 1, task2) } @Test @EnableFlags(Flags.FLAG_ENABLE_DESKTOP_WINDOWING_WALLPAPER_ACTIVITY) fun showDesktopApps_appsAlreadyVisible_bringsToFront_desktopWallpaperEnabled() { Loading