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

Commit a7a9cfd1 authored by Orhan Uysal's avatar Orhan Uysal
Browse files

Move closing task removal to onTaskVanished

Previous closing task removal was making all the tasks minimized instead of removing
from the repo. Move the removal to onTaskVanished as well.

Fix: 372438407
Test: atest FreeformTaskListener
Test: Close 2 apps back to back with X button, ends up on launcher
instead of having an empty desktop
Flag: EXEMPT Bugfix

Change-Id: I911b23603248e5fc906ce22f31c41ee9ccedeb3b
parent b82fcf5c
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -131,6 +131,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);
@@ -158,8 +159,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);
    }