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

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

Merge "Maximize when moving to a smaller display" into main

parents 3f5a77d3 8f8d9255
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -3735,7 +3735,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
@@ -3763,7 +3763,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)
@@ -3777,7 +3777,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)
        }

@@ -3795,10 +3795,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