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

Commit 576d6ba6 authored by Alex Chau's avatar Alex Chau
Browse files

Avoid unnecessarily add stub task for Desktop task

- ag/27016210 caused a regression for DesktopTaskView, where shouldAddStubTaskView returns false whenever DesktopTaskView have multiple tasks
- This is because for an unknown reason, runningTasks for Desktop task is always a single element array. This will be further investigated in b/249371338
- For now, shouldAddStubTaskView will still match DesktopTaskView if any runningTasks matches any of the tasks

Bug: 333844287
Test: With 2 split tasks, unsplit one, go to Overview, launch the other split, unsplit, go to Overview
Test: Swipe up from desktop
Flag: NONE
Change-Id: I40cff473595a21ad1619bcdbde30bb8bfd600e15
parent b014f648
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -2745,8 +2745,10 @@ public abstract class RecentsView<CONTAINER_TYPE extends Context & RecentsViewCo
            return Arrays.stream(runningTasks).anyMatch(
                    runningTask -> !taskView.containsTaskId(runningTask.key.id));
        } else {
            // Ensure the TaskView only contains a single taskId, otherwise add a stub task.
            return taskView.containsMultipleTasks();
            // Ensure the TaskView only contains a single taskId, or is a DesktopTask,
            // otherwise add a stub task.
            // TODO(b/249371338): Figure out why DesktopTask only have a single runningTask.
            return taskView.containsMultipleTasks() && !taskView.isDesktopTask();
        }
    }