Loading libs/WindowManager/Shell/src/com/android/wm/shell/desktopmode/DesktopRepository.kt +3 −1 Original line number Diff line number Diff line Loading @@ -333,7 +333,9 @@ class DesktopRepository( */ private fun addOrMoveFreeformTaskToTop(displayId: Int, taskId: Int) { logD("Add or move task to top: display=%d taskId=%d", taskId, displayId) desktopTaskDataByDisplayId[displayId]?.freeformTasksInZOrder?.remove(taskId) desktopTaskDataByDisplayId.forEach { _, value -> value.freeformTasksInZOrder.remove(taskId) } desktopTaskDataByDisplayId.getOrCreate(displayId).freeformTasksInZOrder.add(0, taskId) // Unminimize the task if it is minimized. unminimizeTask(displayId, taskId) Loading libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/desktopmode/DesktopRepositoryTest.kt +8 −0 Original line number Diff line number Diff line Loading @@ -148,6 +148,14 @@ class DesktopRepositoryTest : ShellTestCase() { assertThat(listener.activeChangesOnSecondaryDisplay).isEqualTo(1) } @Test fun addTask_multipleDisplays_moveToAnotherDisplay() { repo.addTask(DEFAULT_DISPLAY, taskId = 1, isVisible = true) repo.addTask(SECOND_DISPLAY, taskId = 1, isVisible = true) assertThat(repo.getFreeformTasksInZOrder(DEFAULT_DISPLAY)).isEmpty() assertThat(repo.getFreeformTasksInZOrder(SECOND_DISPLAY)).containsExactly(1) } @Test fun removeActiveTask_notifiesActiveTaskListener() { val listener = TestListener() Loading Loading
libs/WindowManager/Shell/src/com/android/wm/shell/desktopmode/DesktopRepository.kt +3 −1 Original line number Diff line number Diff line Loading @@ -333,7 +333,9 @@ class DesktopRepository( */ private fun addOrMoveFreeformTaskToTop(displayId: Int, taskId: Int) { logD("Add or move task to top: display=%d taskId=%d", taskId, displayId) desktopTaskDataByDisplayId[displayId]?.freeformTasksInZOrder?.remove(taskId) desktopTaskDataByDisplayId.forEach { _, value -> value.freeformTasksInZOrder.remove(taskId) } desktopTaskDataByDisplayId.getOrCreate(displayId).freeformTasksInZOrder.add(0, taskId) // Unminimize the task if it is minimized. unminimizeTask(displayId, taskId) Loading
libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/desktopmode/DesktopRepositoryTest.kt +8 −0 Original line number Diff line number Diff line Loading @@ -148,6 +148,14 @@ class DesktopRepositoryTest : ShellTestCase() { assertThat(listener.activeChangesOnSecondaryDisplay).isEqualTo(1) } @Test fun addTask_multipleDisplays_moveToAnotherDisplay() { repo.addTask(DEFAULT_DISPLAY, taskId = 1, isVisible = true) repo.addTask(SECOND_DISPLAY, taskId = 1, isVisible = true) assertThat(repo.getFreeformTasksInZOrder(DEFAULT_DISPLAY)).isEmpty() assertThat(repo.getFreeformTasksInZOrder(SECOND_DISPLAY)).containsExactly(1) } @Test fun removeActiveTask_notifiesActiveTaskListener() { val listener = TestListener() Loading