Loading libs/WindowManager/Shell/src/com/android/wm/shell/desktopmode/DesktopRepository.kt +1 −1 Original line number Diff line number Diff line Loading @@ -470,7 +470,7 @@ class DesktopRepository( * Removes [taskId] from the respective display. If [INVALID_DISPLAY], the original display id * will be looked up from the task id. */ fun removeFreeformTask(displayId: Int, taskId: Int) { fun removeTask(displayId: Int, taskId: Int) { logD("Removes freeform task: taskId=%d", taskId) if (displayId == INVALID_DISPLAY) { // Removes the original display id of the task. Loading libs/WindowManager/Shell/src/com/android/wm/shell/desktopmode/DesktopTaskChangeListener.kt +5 −5 Original line number Diff line number Diff line Loading @@ -29,7 +29,7 @@ class DesktopTaskChangeListener(private val desktopUserRepositories: DesktopUser val desktopRepository: DesktopRepository = desktopUserRepositories.getProfile(taskInfo.userId) if (!isFreeformTask(taskInfo) && desktopRepository.isActiveTask(taskInfo.taskId)) { desktopRepository.removeFreeformTask(taskInfo.displayId, taskInfo.taskId) desktopRepository.removeTask(taskInfo.displayId, taskInfo.taskId) return } if (isFreeformTask(taskInfo)) { Loading @@ -50,7 +50,7 @@ class DesktopTaskChangeListener(private val desktopUserRepositories: DesktopUser desktopRepository.updateTask(taskInfo.displayId, taskInfo.taskId, taskInfo.isVisible) } else { // Case 2: Freeform task is changed outside Desktop Mode. desktopRepository.removeFreeformTask(taskInfo.displayId, taskInfo.taskId) desktopRepository.removeTask(taskInfo.displayId, taskInfo.taskId) } } Loading @@ -60,7 +60,7 @@ class DesktopTaskChangeListener(private val desktopUserRepositories: DesktopUser // Any changes to [DesktopRepository] from this method should be made carefully to minimize risk // of race conditions and possible duplications with [onTaskChanging]. override fun onNonTransitionTaskChanging(taskInfo: RunningTaskInfo) { // TODO: b/367268953 - Propapagate usages from FreeformTaskListener to this method. // TODO: b/367268953 - Propagate usages from FreeformTaskListener to this method. } override fun onTaskMovingToFront(taskInfo: RunningTaskInfo) { Loading @@ -68,7 +68,7 @@ class DesktopTaskChangeListener(private val desktopUserRepositories: DesktopUser desktopUserRepositories.getProfile(taskInfo.userId) if (!desktopRepository.isActiveTask(taskInfo.taskId)) return if (!isFreeformTask(taskInfo)) { desktopRepository.removeFreeformTask(taskInfo.displayId, taskInfo.taskId) desktopRepository.removeTask(taskInfo.displayId, taskInfo.taskId) } // TODO: b/367268953 - Connect this with DesktopRepository for handling // task moving to front for tasks in windowing mode. Loading @@ -90,7 +90,7 @@ class DesktopTaskChangeListener(private val desktopUserRepositories: DesktopUser // A task that's vanishing should be removed: // - If it's closed by the X button which means it's marked as a closing task. desktopRepository.removeClosingTask(taskInfo.taskId) desktopRepository.removeFreeformTask(taskInfo.displayId, taskInfo.taskId) desktopRepository.removeTask(taskInfo.displayId, taskInfo.taskId) } else { desktopRepository.updateTask(taskInfo.displayId, taskInfo.taskId, isVisible = false) desktopRepository.minimizeTask(taskInfo.displayId, taskInfo.taskId) Loading libs/WindowManager/Shell/src/com/android/wm/shell/desktopmode/DesktopTasksTransitionObserver.kt +1 −1 Original line number Diff line number Diff line Loading @@ -141,7 +141,7 @@ class DesktopTasksTransitionObserver( desktopRepository.isActiveTask(taskInfo.taskId) && taskInfo.windowingMode != WINDOWING_MODE_FREEFORM ) { desktopRepository.removeFreeformTask(taskInfo.displayId, taskInfo.taskId) desktopRepository.removeTask(taskInfo.displayId, taskInfo.taskId) } } } Loading libs/WindowManager/Shell/src/com/android/wm/shell/freeform/FreeformTaskListener.java +1 −1 Original line number Diff line number Diff line Loading @@ -127,7 +127,7 @@ public class FreeformTaskListener implements ShellTaskOrganizer.TaskListener, // triggered on a task and the task is closing. It will be marked as minimized in // [DesktopTasksTransitionObserver] before it gets here. repository.removeClosingTask(taskInfo.taskId); repository.removeFreeformTask(taskInfo.displayId, taskInfo.taskId); repository.removeTask(taskInfo.displayId, taskInfo.taskId); } } mWindowDecorationViewModel.onTaskVanished(taskInfo); Loading libs/WindowManager/Shell/src/com/android/wm/shell/recents/RecentTasksController.java +1 −1 Original line number Diff line number Diff line Loading @@ -299,7 +299,7 @@ public class RecentTasksController implements TaskStackListenerCallback, @Override public void onRecentTaskRemovedForAddTask(int taskId) { mDesktopUserRepositories.ifPresent( desktopUserRepositories -> desktopUserRepositories.getCurrent().removeFreeformTask( desktopUserRepositories -> desktopUserRepositories.getCurrent().removeTask( INVALID_DISPLAY, taskId)); } Loading Loading
libs/WindowManager/Shell/src/com/android/wm/shell/desktopmode/DesktopRepository.kt +1 −1 Original line number Diff line number Diff line Loading @@ -470,7 +470,7 @@ class DesktopRepository( * Removes [taskId] from the respective display. If [INVALID_DISPLAY], the original display id * will be looked up from the task id. */ fun removeFreeformTask(displayId: Int, taskId: Int) { fun removeTask(displayId: Int, taskId: Int) { logD("Removes freeform task: taskId=%d", taskId) if (displayId == INVALID_DISPLAY) { // Removes the original display id of the task. Loading
libs/WindowManager/Shell/src/com/android/wm/shell/desktopmode/DesktopTaskChangeListener.kt +5 −5 Original line number Diff line number Diff line Loading @@ -29,7 +29,7 @@ class DesktopTaskChangeListener(private val desktopUserRepositories: DesktopUser val desktopRepository: DesktopRepository = desktopUserRepositories.getProfile(taskInfo.userId) if (!isFreeformTask(taskInfo) && desktopRepository.isActiveTask(taskInfo.taskId)) { desktopRepository.removeFreeformTask(taskInfo.displayId, taskInfo.taskId) desktopRepository.removeTask(taskInfo.displayId, taskInfo.taskId) return } if (isFreeformTask(taskInfo)) { Loading @@ -50,7 +50,7 @@ class DesktopTaskChangeListener(private val desktopUserRepositories: DesktopUser desktopRepository.updateTask(taskInfo.displayId, taskInfo.taskId, taskInfo.isVisible) } else { // Case 2: Freeform task is changed outside Desktop Mode. desktopRepository.removeFreeformTask(taskInfo.displayId, taskInfo.taskId) desktopRepository.removeTask(taskInfo.displayId, taskInfo.taskId) } } Loading @@ -60,7 +60,7 @@ class DesktopTaskChangeListener(private val desktopUserRepositories: DesktopUser // Any changes to [DesktopRepository] from this method should be made carefully to minimize risk // of race conditions and possible duplications with [onTaskChanging]. override fun onNonTransitionTaskChanging(taskInfo: RunningTaskInfo) { // TODO: b/367268953 - Propapagate usages from FreeformTaskListener to this method. // TODO: b/367268953 - Propagate usages from FreeformTaskListener to this method. } override fun onTaskMovingToFront(taskInfo: RunningTaskInfo) { Loading @@ -68,7 +68,7 @@ class DesktopTaskChangeListener(private val desktopUserRepositories: DesktopUser desktopUserRepositories.getProfile(taskInfo.userId) if (!desktopRepository.isActiveTask(taskInfo.taskId)) return if (!isFreeformTask(taskInfo)) { desktopRepository.removeFreeformTask(taskInfo.displayId, taskInfo.taskId) desktopRepository.removeTask(taskInfo.displayId, taskInfo.taskId) } // TODO: b/367268953 - Connect this with DesktopRepository for handling // task moving to front for tasks in windowing mode. Loading @@ -90,7 +90,7 @@ class DesktopTaskChangeListener(private val desktopUserRepositories: DesktopUser // A task that's vanishing should be removed: // - If it's closed by the X button which means it's marked as a closing task. desktopRepository.removeClosingTask(taskInfo.taskId) desktopRepository.removeFreeformTask(taskInfo.displayId, taskInfo.taskId) desktopRepository.removeTask(taskInfo.displayId, taskInfo.taskId) } else { desktopRepository.updateTask(taskInfo.displayId, taskInfo.taskId, isVisible = false) desktopRepository.minimizeTask(taskInfo.displayId, taskInfo.taskId) Loading
libs/WindowManager/Shell/src/com/android/wm/shell/desktopmode/DesktopTasksTransitionObserver.kt +1 −1 Original line number Diff line number Diff line Loading @@ -141,7 +141,7 @@ class DesktopTasksTransitionObserver( desktopRepository.isActiveTask(taskInfo.taskId) && taskInfo.windowingMode != WINDOWING_MODE_FREEFORM ) { desktopRepository.removeFreeformTask(taskInfo.displayId, taskInfo.taskId) desktopRepository.removeTask(taskInfo.displayId, taskInfo.taskId) } } } Loading
libs/WindowManager/Shell/src/com/android/wm/shell/freeform/FreeformTaskListener.java +1 −1 Original line number Diff line number Diff line Loading @@ -127,7 +127,7 @@ public class FreeformTaskListener implements ShellTaskOrganizer.TaskListener, // triggered on a task and the task is closing. It will be marked as minimized in // [DesktopTasksTransitionObserver] before it gets here. repository.removeClosingTask(taskInfo.taskId); repository.removeFreeformTask(taskInfo.displayId, taskInfo.taskId); repository.removeTask(taskInfo.displayId, taskInfo.taskId); } } mWindowDecorationViewModel.onTaskVanished(taskInfo); Loading
libs/WindowManager/Shell/src/com/android/wm/shell/recents/RecentTasksController.java +1 −1 Original line number Diff line number Diff line Loading @@ -299,7 +299,7 @@ public class RecentTasksController implements TaskStackListenerCallback, @Override public void onRecentTaskRemovedForAddTask(int taskId) { mDesktopUserRepositories.ifPresent( desktopUserRepositories -> desktopUserRepositories.getCurrent().removeFreeformTask( desktopUserRepositories -> desktopUserRepositories.getCurrent().removeTask( INVALID_DISPLAY, taskId)); } Loading