Loading libs/WindowManager/Shell/src/com/android/wm/shell/desktopmode/DesktopModeController.java +5 −0 Original line number Diff line number Diff line Loading @@ -519,6 +519,11 @@ public class DesktopModeController implements RemoteCallable<DesktopModeControll controller -> controller.showDesktopApps(displayId)); } @Override public void showDesktopApp(int taskId) throws RemoteException { // TODO } @Override public int getVisibleTaskCount(int displayId) throws RemoteException { int[] result = new int[1]; Loading libs/WindowManager/Shell/src/com/android/wm/shell/desktopmode/DesktopTasksController.kt +12 −0 Original line number Diff line number Diff line Loading @@ -278,6 +278,11 @@ class DesktopTasksController( } } /** Move a task to the front */ fun moveTaskToFront(taskId: Int) { shellTaskOrganizer.getRunningTaskInfo(taskId)?.let { task -> moveTaskToFront(task) } } /** Move a task to the front */ fun moveTaskToFront(taskInfo: RunningTaskInfo) { KtProtoLog.v( Loading Loading @@ -795,6 +800,13 @@ class DesktopTasksController( ) { c -> c.hideStashedDesktopApps(displayId) } } override fun showDesktopApp(taskId: Int) { ExecutorUtils.executeRemoteCallWithTaskPermission( controller, "showDesktopApp" ) { c -> c.moveTaskToFront(taskId) } } override fun getVisibleTaskCount(displayId: Int): Int { val result = IntArray(1) ExecutorUtils.executeRemoteCallWithTaskPermission( Loading libs/WindowManager/Shell/src/com/android/wm/shell/desktopmode/IDesktopMode.aidl +3 −0 Original line number Diff line number Diff line Loading @@ -32,6 +32,9 @@ interface IDesktopMode { /** Hide apps that may be stashed */ void hideStashedDesktopApps(int displayId); /** Bring task with the given id to front */ oneway void showDesktopApp(int taskId); /** Get count of visible desktop tasks on the given display */ int getVisibleTaskCount(int displayId); Loading libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/desktopmode/DesktopTasksControllerTest.kt +12 −0 Original line number Diff line number Diff line Loading @@ -344,6 +344,18 @@ class DesktopTasksControllerTest : ShellTestCase() { } } @Test fun moveTaskToFront_postsWctWithReorderOp() { val task1 = setUpFreeformTask() val task2 = setUpFreeformTask() controller.moveTaskToFront(task1) val wct = getLatestWct(expectTransition = TRANSIT_TO_FRONT) assertThat(wct.hierarchyOps).hasSize(1) wct.assertReorderAt(index = 0, task1) } @Test fun moveToNextDisplay_noOtherDisplays() { whenever(rootTaskDisplayAreaOrganizer.displayIds).thenReturn(intArrayOf(DEFAULT_DISPLAY)) Loading Loading
libs/WindowManager/Shell/src/com/android/wm/shell/desktopmode/DesktopModeController.java +5 −0 Original line number Diff line number Diff line Loading @@ -519,6 +519,11 @@ public class DesktopModeController implements RemoteCallable<DesktopModeControll controller -> controller.showDesktopApps(displayId)); } @Override public void showDesktopApp(int taskId) throws RemoteException { // TODO } @Override public int getVisibleTaskCount(int displayId) throws RemoteException { int[] result = new int[1]; Loading
libs/WindowManager/Shell/src/com/android/wm/shell/desktopmode/DesktopTasksController.kt +12 −0 Original line number Diff line number Diff line Loading @@ -278,6 +278,11 @@ class DesktopTasksController( } } /** Move a task to the front */ fun moveTaskToFront(taskId: Int) { shellTaskOrganizer.getRunningTaskInfo(taskId)?.let { task -> moveTaskToFront(task) } } /** Move a task to the front */ fun moveTaskToFront(taskInfo: RunningTaskInfo) { KtProtoLog.v( Loading Loading @@ -795,6 +800,13 @@ class DesktopTasksController( ) { c -> c.hideStashedDesktopApps(displayId) } } override fun showDesktopApp(taskId: Int) { ExecutorUtils.executeRemoteCallWithTaskPermission( controller, "showDesktopApp" ) { c -> c.moveTaskToFront(taskId) } } override fun getVisibleTaskCount(displayId: Int): Int { val result = IntArray(1) ExecutorUtils.executeRemoteCallWithTaskPermission( Loading
libs/WindowManager/Shell/src/com/android/wm/shell/desktopmode/IDesktopMode.aidl +3 −0 Original line number Diff line number Diff line Loading @@ -32,6 +32,9 @@ interface IDesktopMode { /** Hide apps that may be stashed */ void hideStashedDesktopApps(int displayId); /** Bring task with the given id to front */ oneway void showDesktopApp(int taskId); /** Get count of visible desktop tasks on the given display */ int getVisibleTaskCount(int displayId); Loading
libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/desktopmode/DesktopTasksControllerTest.kt +12 −0 Original line number Diff line number Diff line Loading @@ -344,6 +344,18 @@ class DesktopTasksControllerTest : ShellTestCase() { } } @Test fun moveTaskToFront_postsWctWithReorderOp() { val task1 = setUpFreeformTask() val task2 = setUpFreeformTask() controller.moveTaskToFront(task1) val wct = getLatestWct(expectTransition = TRANSIT_TO_FRONT) assertThat(wct.hierarchyOps).hasSize(1) wct.assertReorderAt(index = 0, task1) } @Test fun moveToNextDisplay_noOtherDisplays() { whenever(rootTaskDisplayAreaOrganizer.displayIds).thenReturn(intArrayOf(DEFAULT_DISPLAY)) Loading