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

Commit 8f8d9255 authored by Daichi Hirono's avatar Daichi Hirono
Browse files

Maximize when moving to a smaller display

This CL applies the new UX requirement when moving a task to a display
that's smaller than the task itself.

Bug: 421282199
Flag: com.android.window.flags.enable_move_to_next_display_shortcut
Test: DesktopTasksControllerTest
Test: WMShellSmokeTestsDesktopMode
Change-Id: Ie05c5172fd7c16a57b54881bec11c7faab94771e
parent 3a6dcfef
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -3686,7 +3686,7 @@ class DesktopTasksController(
                    )
                }
            } else {
                getInitialBounds(destLayout, taskInfo, destDeskId)
                calculateMaximizeBounds(destLayout, taskInfo)
            }
        wct.setBounds(taskInfo.token, boundsWithinDisplay)
    }
+6 −6
Original line number Diff line number Diff line
@@ -3705,7 +3705,7 @@ class DesktopTasksControllerTest(flags: FlagsParameterization) : ShellTestCase()

    @Test
    @EnableFlags(FLAG_ENABLE_MOVE_TO_NEXT_DISPLAY_SHORTCUT)
    fun moveToNextDisplay_defaultBoundsWhenDestinationTooSmall() {
    fun moveToNextDisplay_maximizeWhenDestinationTooSmall() {
        taskRepository.addDesk(displayId = SECOND_DISPLAY, deskId = SECOND_DISPLAY)
        // Set up two display ids
        whenever(rootTaskDisplayAreaOrganizer.displayIds)
@@ -3719,7 +3719,7 @@ class DesktopTasksControllerTest(flags: FlagsParameterization) : ShellTestCase()
        whenever(secondaryLayout.densityDpi()).thenReturn(160)
        whenever(secondaryLayout.width()).thenReturn(640)
        whenever(secondaryLayout.height()).thenReturn(480)
        whenever(secondaryLayout.getStableBoundsForDesktopMode(any())).thenAnswer { i ->
        whenever(secondaryLayout.getStableBounds(any())).thenAnswer { i ->
            (i.arguments.first() as Rect).set(0, 0, 640, 480)
        }

@@ -3737,10 +3737,10 @@ class DesktopTasksControllerTest(flags: FlagsParameterization) : ShellTestCase()
                )
                .changes[task.token.asBinder()]
        assertNotNull(taskChange)
        assertThat(taskChange.configuration.windowConfiguration.bounds.left).isAtLeast(0)
        assertThat(taskChange.configuration.windowConfiguration.bounds.top).isAtLeast(0)
        assertThat(taskChange.configuration.windowConfiguration.bounds.right).isAtMost(640)
        assertThat(taskChange.configuration.windowConfiguration.bounds.bottom).isAtMost(480)
        assertThat(taskChange.configuration.windowConfiguration.bounds.left).isEqualTo(0)
        assertThat(taskChange.configuration.windowConfiguration.bounds.top).isEqualTo(0)
        assertThat(taskChange.configuration.windowConfiguration.bounds.right).isEqualTo(640)
        assertThat(taskChange.configuration.windowConfiguration.bounds.bottom).isEqualTo(480)
    }

    @Test