Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 65dc85ec authored by Treehugger Robot's avatar Treehugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Move closing task removal to onTaskVanished" into main

parents e595e819 a7a9cfd1
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -126,6 +126,7 @@ public class FreeformTaskListener implements ShellTaskOrganizer.TaskListener,
                        || repository.isClosingTask(taskInfo.taskId)) {
                    // 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.
                    repository.removeClosingTask(taskInfo.taskId);
                    repository.removeFreeformTask(taskInfo.displayId, taskInfo.taskId);
                } else {
                    repository.updateTaskVisibility(taskInfo.displayId, taskInfo.taskId, false);
@@ -150,8 +151,6 @@ public class FreeformTaskListener implements ShellTaskOrganizer.TaskListener,
            mDesktopRepository.ifPresent(repository -> {
                if (taskInfo.isVisible) {
                    repository.addActiveTask(taskInfo.displayId, taskInfo.taskId);
                } else if (repository.isClosingTask(taskInfo.taskId)) {
                    repository.removeClosingTask(taskInfo.taskId);
                }
                repository.updateTaskVisibility(taskInfo.displayId, taskInfo.taskId,
                        taskInfo.isVisible);
+1 −0
Original line number Diff line number Diff line
@@ -178,6 +178,7 @@ public final class FreeformTaskListenerTests extends ShellTestCase {
        mFreeformTaskListener.onTaskVanished(task);

        verify(mDesktopRepository, never()).minimizeTask(task.displayId, task.taskId);
        verify(mDesktopRepository).removeClosingTask(task.taskId);
        verify(mDesktopRepository).removeFreeformTask(task.displayId, task.taskId);
    }