Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 6b3688ef authored by Treehugger Robot's avatar Treehugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Ignore wallpaper task when moving task to next display" into main

parents b2de7084 37c0acd1
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -2343,7 +2343,10 @@ class DesktopTasksController(
                )
                return@moveToNextDisplay false
            }
            val focusedNonDesktopTasks = getFocusedNonDesktopTasks(displayId, userId)
            val focusedNonDesktopTasks =
                getFocusedNonDesktopTasks(displayId, userId).filter {
                    !DesktopWallpaperActivity.isWallpaperTask(it)
                }
            if (!focusedNonDesktopTasks.isEmpty()) {
                logD(
                    "moveToNextDesktopDisplay: Skip displayId=$displayId as it has focused " +
+31 −0
Original line number Diff line number Diff line
@@ -4554,6 +4554,37 @@ class DesktopTasksControllerTest(flags: FlagsParameterization) : ShellTestCase()
            )
    }
    @Test
    fun moveToNextDesktopDisplay_moveIfDestinationFocusesDesktopWallpaper() {
        // Set up displays
        whenever(rootTaskDisplayAreaOrganizer.displayIds)
            .thenReturn(intArrayOf(DEFAULT_DISPLAY, SECOND_DISPLAY))
        taskRepository.addDesk(displayId = SECOND_DISPLAY, deskId = 2)
        desktopState.overrideDesktopModeSupportPerDisplay[SECOND_DISPLAY] = true
        // Set up a focused fullscreen task on the secondary display
        val fullscreenTask = setUpFullscreenTask(displayId = SECOND_DISPLAY)
        fullscreenTask.isFocused = true
        fullscreenTask.baseIntent =
            Intent().apply { component = DesktopWallpaperActivity.wallpaperActivityComponent }
        // Set up a task on the default display
        val task = setUpFreeformTask(displayId = DEFAULT_DISPLAY)
        controller.moveToNextDesktopDisplay(
            taskId = task.taskId,
            userId = taskRepository.userId,
            enterReason = EnterReason.UNKNOWN_ENTER,
        )
        verify(transitions)
            .startTransition(
                eq(TRANSIT_CHANGE),
                any<WindowContainerTransaction>(),
                isA(DesktopModeMoveToDisplayTransitionHandler::class.java),
            )
    }
    @Test
    fun getTaskWindowingMode() {
        val fullscreenTask = setUpFullscreenTask()