Loading libs/WindowManager/Shell/src/com/android/wm/shell/desktopmode/DesktopDisplayEventHandler.kt +14 −10 Original line number Diff line number Diff line Loading @@ -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 } Loading libs/WindowManager/Shell/src/com/android/wm/shell/desktopmode/DesktopModeShellCommandHandler.kt +3 −3 Original line number Diff line number Diff line Loading @@ -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 } Loading libs/WindowManager/Shell/src/com/android/wm/shell/desktopmode/DesktopPipTransitionController.kt +1 −0 Original line number Diff line number Diff line Loading @@ -316,6 +316,7 @@ class DesktopPipTransitionController( wct = wct, deskId = deskId, displayId = displayId, userId = taskInfo.userId, willExitDesktop = true, removingLastTaskId = taskId, exitReason = ExitReason.ENTER_PIP, Loading libs/WindowManager/Shell/src/com/android/wm/shell/desktopmode/DesktopTasksController.kt +162 −112 File changed.Preview size limit exceeded, changes collapsed. Show changes libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/desktopmode/DesktopDisplayEventHandlerTest.kt +3 −2 Original line number Diff line number Diff line Loading @@ -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) } Loading Loading @@ -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 Loading
libs/WindowManager/Shell/src/com/android/wm/shell/desktopmode/DesktopDisplayEventHandler.kt +14 −10 Original line number Diff line number Diff line Loading @@ -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 } Loading
libs/WindowManager/Shell/src/com/android/wm/shell/desktopmode/DesktopModeShellCommandHandler.kt +3 −3 Original line number Diff line number Diff line Loading @@ -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 } Loading
libs/WindowManager/Shell/src/com/android/wm/shell/desktopmode/DesktopPipTransitionController.kt +1 −0 Original line number Diff line number Diff line Loading @@ -316,6 +316,7 @@ class DesktopPipTransitionController( wct = wct, deskId = deskId, displayId = displayId, userId = taskInfo.userId, willExitDesktop = true, removingLastTaskId = taskId, exitReason = ExitReason.ENTER_PIP, Loading
libs/WindowManager/Shell/src/com/android/wm/shell/desktopmode/DesktopTasksController.kt +162 −112 File changed.Preview size limit exceeded, changes collapsed. Show changes
libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/desktopmode/DesktopDisplayEventHandlerTest.kt +3 −2 Original line number Diff line number Diff line Loading @@ -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) } Loading Loading @@ -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