Loading libs/WindowManager/Shell/src/com/android/wm/shell/desktopmode/DesktopModeShellCommandHandler.kt +28 −1 Original line number Diff line number Diff line Loading @@ -36,7 +36,14 @@ class DesktopModeShellCommandHandler(private val controller: DesktopTasksControl true } } "moveToNextDisplay" -> { if (!runMoveToNextDisplay(args, pw)) { pw.println("Task not found. Please enter a valid taskId.") false } else { true } } else -> { pw.println("Invalid command: ${args[0]}") false Loading @@ -61,8 +68,28 @@ class DesktopModeShellCommandHandler(private val controller: DesktopTasksControl return controller.moveToDesktop(taskId, WindowContainerTransaction()) } private fun runMoveToNextDisplay(args: Array<String>, pw: PrintWriter): Boolean { if (args.size < 2) { // First argument is the action name. pw.println("Error: task id should be provided as arguments") return false } val taskId = try { args[1].toInt() } catch (e: NumberFormatException) { pw.println("Error: task id should be an integer") return false } controller.moveToNextDisplay(taskId) return true } override fun printShellCommandHelp(pw: PrintWriter, prefix: String) { pw.println("$prefix moveToDesktop <taskId> ") pw.println("$prefix Move a task with given id to desktop mode.") pw.println("$prefix moveToNextDisplay <taskId> ") pw.println("$prefix Move a task with given id to next display.") } } No newline at end of file Loading
libs/WindowManager/Shell/src/com/android/wm/shell/desktopmode/DesktopModeShellCommandHandler.kt +28 −1 Original line number Diff line number Diff line Loading @@ -36,7 +36,14 @@ class DesktopModeShellCommandHandler(private val controller: DesktopTasksControl true } } "moveToNextDisplay" -> { if (!runMoveToNextDisplay(args, pw)) { pw.println("Task not found. Please enter a valid taskId.") false } else { true } } else -> { pw.println("Invalid command: ${args[0]}") false Loading @@ -61,8 +68,28 @@ class DesktopModeShellCommandHandler(private val controller: DesktopTasksControl return controller.moveToDesktop(taskId, WindowContainerTransaction()) } private fun runMoveToNextDisplay(args: Array<String>, pw: PrintWriter): Boolean { if (args.size < 2) { // First argument is the action name. pw.println("Error: task id should be provided as arguments") return false } val taskId = try { args[1].toInt() } catch (e: NumberFormatException) { pw.println("Error: task id should be an integer") return false } controller.moveToNextDisplay(taskId) return true } override fun printShellCommandHelp(pw: PrintWriter, prefix: String) { pw.println("$prefix moveToDesktop <taskId> ") pw.println("$prefix Move a task with given id to desktop mode.") pw.println("$prefix moveToNextDisplay <taskId> ") pw.println("$prefix Move a task with given id to next display.") } } No newline at end of file