Loading libs/WindowManager/Shell/src/com/android/wm/shell/desktopmode/DesktopModeController.java +5 −0 Original line number Diff line number Diff line Loading @@ -514,6 +514,11 @@ public class DesktopModeController implements RemoteCallable<DesktopModeControll // Stashing of desktop apps not needed. Apps always launch on desktop } @Override public void hideStashedDesktopApps(int displayId) throws RemoteException { // Stashing of desktop apps not needed. Apps always launch on desktop } @Override public void setTaskListener(IDesktopTaskListener listener) throws RemoteException { // TODO(b/261234402): move visibility from sysui state to listener Loading libs/WindowManager/Shell/src/com/android/wm/shell/desktopmode/DesktopTasksController.kt +19 −0 Original line number Diff line number Diff line Loading @@ -131,6 +131,18 @@ class DesktopTasksController( desktopModeTaskRepository.setStashed(displayId, true) } /** * Clear the stashed state for the given display */ fun hideStashedDesktopApps(displayId: Int) { KtProtoLog.v( WM_SHELL_DESKTOP_MODE, "DesktopTasksController: hideStashedApps displayId=%d", displayId ) desktopModeTaskRepository.setStashed(displayId, false) } /** Get number of tasks that are marked as visible */ fun getVisibleTaskCount(displayId: Int): Int { return desktopModeTaskRepository.getVisibleTaskCount(displayId) Loading Loading @@ -753,6 +765,13 @@ class DesktopTasksController( ) { c -> c.stashDesktopApps(displayId) } } override fun hideStashedDesktopApps(displayId: Int) { ExecutorUtils.executeRemoteCallWithTaskPermission( controller, "hideStashedDesktopApps" ) { c -> c.hideStashedDesktopApps(displayId) } } 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 @@ -29,6 +29,9 @@ interface IDesktopMode { /** Stash apps on the desktop to allow launching another app from home screen */ void stashDesktopApps(int displayId); /** Hide apps that may be stashed */ void hideStashedDesktopApps(int displayId); /** 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 +11 −0 Original line number Diff line number Diff line Loading @@ -587,6 +587,17 @@ class DesktopTasksControllerTest : ShellTestCase() { assertThat(desktopModeTaskRepository.isStashed(SECOND_DISPLAY)).isFalse() } @Test fun hideStashedDesktopApps_stateUpdates() { desktopModeTaskRepository.setStashed(DEFAULT_DISPLAY, true) desktopModeTaskRepository.setStashed(SECOND_DISPLAY, true) controller.hideStashedDesktopApps(DEFAULT_DISPLAY) assertThat(desktopModeTaskRepository.isStashed(DEFAULT_DISPLAY)).isFalse() // Check that second display is not affected assertThat(desktopModeTaskRepository.isStashed(SECOND_DISPLAY)).isTrue() } private fun setUpFreeformTask(displayId: Int = DEFAULT_DISPLAY): RunningTaskInfo { val task = createFreeformTask(displayId) whenever(shellTaskOrganizer.getRunningTaskInfo(task.taskId)).thenReturn(task) Loading Loading
libs/WindowManager/Shell/src/com/android/wm/shell/desktopmode/DesktopModeController.java +5 −0 Original line number Diff line number Diff line Loading @@ -514,6 +514,11 @@ public class DesktopModeController implements RemoteCallable<DesktopModeControll // Stashing of desktop apps not needed. Apps always launch on desktop } @Override public void hideStashedDesktopApps(int displayId) throws RemoteException { // Stashing of desktop apps not needed. Apps always launch on desktop } @Override public void setTaskListener(IDesktopTaskListener listener) throws RemoteException { // TODO(b/261234402): move visibility from sysui state to listener Loading
libs/WindowManager/Shell/src/com/android/wm/shell/desktopmode/DesktopTasksController.kt +19 −0 Original line number Diff line number Diff line Loading @@ -131,6 +131,18 @@ class DesktopTasksController( desktopModeTaskRepository.setStashed(displayId, true) } /** * Clear the stashed state for the given display */ fun hideStashedDesktopApps(displayId: Int) { KtProtoLog.v( WM_SHELL_DESKTOP_MODE, "DesktopTasksController: hideStashedApps displayId=%d", displayId ) desktopModeTaskRepository.setStashed(displayId, false) } /** Get number of tasks that are marked as visible */ fun getVisibleTaskCount(displayId: Int): Int { return desktopModeTaskRepository.getVisibleTaskCount(displayId) Loading Loading @@ -753,6 +765,13 @@ class DesktopTasksController( ) { c -> c.stashDesktopApps(displayId) } } override fun hideStashedDesktopApps(displayId: Int) { ExecutorUtils.executeRemoteCallWithTaskPermission( controller, "hideStashedDesktopApps" ) { c -> c.hideStashedDesktopApps(displayId) } } 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 @@ -29,6 +29,9 @@ interface IDesktopMode { /** Stash apps on the desktop to allow launching another app from home screen */ void stashDesktopApps(int displayId); /** Hide apps that may be stashed */ void hideStashedDesktopApps(int displayId); /** 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 +11 −0 Original line number Diff line number Diff line Loading @@ -587,6 +587,17 @@ class DesktopTasksControllerTest : ShellTestCase() { assertThat(desktopModeTaskRepository.isStashed(SECOND_DISPLAY)).isFalse() } @Test fun hideStashedDesktopApps_stateUpdates() { desktopModeTaskRepository.setStashed(DEFAULT_DISPLAY, true) desktopModeTaskRepository.setStashed(SECOND_DISPLAY, true) controller.hideStashedDesktopApps(DEFAULT_DISPLAY) assertThat(desktopModeTaskRepository.isStashed(DEFAULT_DISPLAY)).isFalse() // Check that second display is not affected assertThat(desktopModeTaskRepository.isStashed(SECOND_DISPLAY)).isTrue() } private fun setUpFreeformTask(displayId: Int = DEFAULT_DISPLAY): RunningTaskInfo { val task = createFreeformTask(displayId) whenever(shellTaskOrganizer.getRunningTaskInfo(task.taskId)).thenReturn(task) Loading