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

Commit 613b0df6 authored by Daichi Hirono's avatar Daichi Hirono
Browse files

Run moveToNextDisplay on the executor

This CL fixes DesktopModeKeyGestureHandler so that it invokes
moveToNextDisplay on the shell main thread, because all ShellTransition
needs to be interacted with on the thread.

Bug: 364154795
Flag: com.android.window.flags.enable_move_to_next_display_shortcut
Test: None
Change-Id: I1024b1e17422f9658594e779621d8c02d5936cb9
parent 142c8f55
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -65,8 +65,10 @@ class DesktopModeKeyGestureHandler(
            KeyGestureEvent.KEY_GESTURE_TYPE_MOVE_TO_NEXT_DISPLAY -> {
                logV("Key gesture MOVE_TO_NEXT_DISPLAY is handled")
                getGloballyFocusedFreeformTask()?.let {
                    mainExecutor.execute {
                        desktopTasksController.get().moveToNextDisplay(it.taskId)
                    }
                }
                return true
            }
            KeyGestureEvent.KEY_GESTURE_TYPE_SNAP_LEFT_FREEFORM_WINDOW -> {
+1 −0
Original line number Diff line number Diff line
@@ -183,6 +183,7 @@ class DesktopModeKeyGestureHandlerTest : ShellTestCase() {
            .setModifierState(KeyEvent.META_META_ON or KeyEvent.META_CTRL_ON)
            .build()
        val result = keyGestureEventHandler.handleKeyGestureEvent(event, null)
        testExecutor.flushAll()

        assertThat(result).isTrue()
        verify(desktopTasksController).moveToNextDisplay(task.taskId)