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

Commit 06d2c5fe authored by Daichi Hirono's avatar Daichi Hirono
Browse files

Add more logging for moveToNextDisplay feature

Bug: 364154795
Flag: com.android.window.flags.enable_move_to_next_display_shortcut
Test: DesktopTasksControllerTest
Test: run CD smoke tests
Change-Id: I6c9bfc0683e46e51c9ae874830f4d8747231b98c
parent 5c9d2f47
Loading
Loading
Loading
Loading
+11 −0
Original line number Diff line number Diff line
@@ -70,10 +70,17 @@ class DesktopModeKeyGestureHandler(
            KeyGestureEvent.KEY_GESTURE_TYPE_MOVE_TO_NEXT_DISPLAY -> {
                logV("Key gesture MOVE_TO_NEXT_DISPLAY is handled")
                getGloballyFocusedDesktopTask()?.let {
                    logV("Found globally focused desktop task to move: ${it.taskId}")
                    mainExecutor.execute {
                        desktopTasksController.get().moveToNextDesktopDisplay(it.taskId)
                    }
                }
                    ?: logW(
                        "No globally focused desktop task to move: " +
                            "globallyFocusedTaskId=%d globallyFocusedDisplayId=%d",
                        focusTransitionObserver.globallyFocusedTaskId,
                        focusTransitionObserver.globallyFocusedDisplayId,
                    )
            }
            KeyGestureEvent.KEY_GESTURE_TYPE_SWITCH_TO_PREVIOUS_DESK -> {
                logV("Key gesture SWITCH_TO_PREVIOUS_DESK is handled")
@@ -174,6 +181,10 @@ class DesktopModeKeyGestureHandler(
        ProtoLog.v(WM_SHELL_DESKTOP_MODE, "%s: $msg", TAG, *arguments)
    }

    private fun logW(msg: String, vararg arguments: Any?) {
        ProtoLog.w(WM_SHELL_DESKTOP_MODE, "%s: $msg", TAG, *arguments)
    }

    companion object {
        private const val TAG = "DesktopModeKeyGestureHandler"
    }