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

Commit 27743398 authored by Jorge Gil's avatar Jorge Gil Committed by Android (Google) Code Review
Browse files

Merge "[1/N] Replace global userId with per-function argument" into main

parents a75305a8 ff2254ab
Loading
Loading
Loading
Loading
+14 −10
Original line number Diff line number Diff line
@@ -185,17 +185,21 @@ class DesktopDisplayEventHandler(
    }

    private fun handlePotentialReconnect(displayId: Int): Boolean {
        val uniqueDisplayId = displayController.getDisplay(displayId)?.uniqueId
        uniqueDisplayId?.let {
            uniqueIdByDisplayId[displayId] = it
        val uniqueDisplayId = displayController.getDisplay(displayId)?.uniqueId ?: return false
        uniqueIdByDisplayId[displayId] = uniqueDisplayId
        if (
            DesktopExperienceFlags.ENABLE_DISPLAY_RECONNECT_INTERACTION.isTrue &&
                    desktopUserRepositories.current.hasPreservedDisplayForUniqueDisplayId(it)
                desktopUserRepositories.current.hasPreservedDisplayForUniqueDisplayId(
                    uniqueDisplayId
                )
        ) {
                desktopTasksController.restoreDisplay(displayId, it)
            desktopTasksController.restoreDisplay(
                displayId = displayId,
                uniqueDisplayId = uniqueDisplayId,
                userId = desktopUserRepositories.current.userId,
            )
            return true
        }
        }
        return false
    }

+3 −3
Original line number Diff line number Diff line
@@ -203,9 +203,9 @@ class DesktopModeShellCommandHandler(
                return false
            }
        controller.moveTaskToFront(
            /* taskId= */ taskId,
            /* remoteTransition= */ null,
            /* unminimizeReason= */ UnminimizeReason.UNKNOWN,
            taskId = taskId,
            remoteTransition = null,
            unminimizeReason = UnminimizeReason.UNKNOWN,
        )
        return true
    }
+1 −0
Original line number Diff line number Diff line
@@ -316,6 +316,7 @@ class DesktopPipTransitionController(
                wct = wct,
                deskId = deskId,
                displayId = displayId,
                userId = taskInfo.userId,
                willExitDesktop = true,
                removingLastTaskId = taskId,
                exitReason = ExitReason.ENTER_PIP,
+162 −112

File changed.

Preview size limit exceeded, changes collapsed.

+3 −2
Original line number Diff line number Diff line
@@ -342,7 +342,8 @@ class DesktopDisplayEventHandlerTest : ShellTestCase() {
            handler.onDeskRemoved(DEFAULT_DISPLAY, deskId = 1)
            runCurrent()

            verify(mockDesktopTasksController, never()).createDesk(DEFAULT_DISPLAY)
            verify(mockDesktopTasksController, never())
                .createDesk(eq(DEFAULT_DISPLAY), any(), any(), any(), any())
            verify(mockDesksOrganizer, never())
                .warmUpDefaultDesk(DEFAULT_DISPLAY, mockDesktopRepository.userId)
        }
@@ -443,7 +444,7 @@ class DesktopDisplayEventHandlerTest : ShellTestCase() {
            .thenReturn(true)
        onDisplaysChangedListenerCaptor.lastValue.onDesktopModeEligibleChanged(externalDisplayId)
        verify(mockDesktopTasksController)
            .restoreDisplay(eq(externalDisplayId), eq(UNIQUE_DISPLAY_ID))
            .restoreDisplay(eq(externalDisplayId), eq(UNIQUE_DISPLAY_ID), eq(PRIMARY_USER_ID))
    }

    private fun addDisplay(displayId: Int, withTda: Boolean = false) {
Loading