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

Commit a8792453 authored by Jorge Gil's avatar Jorge Gil
Browse files

[40/N] Desks: Fix failing WMShellUnitTests

Also adds the missing setFlagParameterization call in
DesktopTasksController needed for the tests to actually run with the
flag enabled.

Flag: com.android.window.flags.enable_multiple_desktops_backend
Bug: 362720497
Test: atest WMShellUnitTests
Change-Id: I05ef9baff29d72b792943f0d850e9e079ed2c645
parent c0add4e1
Loading
Loading
Loading
Loading
+5 −2
Original line number Diff line number Diff line
@@ -716,12 +716,15 @@ class DesktopRepository(
    }

    /**
     * Returns the top transparent fullscreen task id for a given display's active desk, or null.
     * Returns the top transparent fullscreen task id for a given display, or null.
     *
     * TODO: b/389960283 - add explicit [deskId] argument.
     */
    fun getTopTransparentFullscreenTaskId(displayId: Int): Int? =
        desktopData.getActiveDesk(displayId)?.topTransparentFullscreenTaskId
        desktopData
            .desksSequence(displayId)
            .mapNotNull { it.topTransparentFullscreenTaskId }
            .firstOrNull()

    /**
     * Clears the top transparent fullscreen task id info for a given display's active desk.
+3 −0
Original line number Diff line number Diff line
@@ -114,6 +114,8 @@ class DesktopImmersiveControllerTest : ShellTestCase() {
                transactionSupplier = transactionSupplier,
            )
        desktopRepository = userRepositories.current
        desktopRepository.addDesk(DEFAULT_DISPLAY, DEFAULT_DESK_ID)
        desktopRepository.setActiveDesk(DEFAULT_DISPLAY, DEFAULT_DESK_ID)
    }

    @Test
@@ -835,5 +837,6 @@ class DesktopImmersiveControllerTest : ShellTestCase() {
    companion object {
        private val STABLE_BOUNDS = Rect(0, 100, 2000, 1900)
        private val DISPLAY_BOUNDS = Rect(0, 0, 2000, 2000)
        private const val DEFAULT_DESK_ID = 0
    }
}
+348 −38

File changed.

Preview size limit exceeded, changes collapsed.