Add TasksRepository

Bug: 334825222
Test: TasksRepositoryTest
Flag: com.android.launcher3.enable_refactor_task_thumbnail
Change-Id: I3e08dea7b205df54f8bef456ead6466aa2ce45c6
This commit is contained in:
Uwais Ashraf
2024-05-20 21:19:22 +00:00
parent e21d6b15d5
commit f6f34ca441
15 changed files with 456 additions and 25 deletions
@@ -148,7 +148,7 @@ public final class KeyboardQuickSwitchController implements
});
}
private void processLoadedTasks(ArrayList<GroupTask> tasks) {
private void processLoadedTasks(List<GroupTask> tasks) {
// Only store MAX_TASK tasks, from most to least recent
Collections.reverse(tasks);
mTasks = tasks.stream()
@@ -157,7 +157,7 @@ public final class KeyboardQuickSwitchController implements
mNumHiddenTasks = Math.max(0, tasks.size() - MAX_TASKS);
}
private void processLoadedTasksOnDesktop(ArrayList<GroupTask> tasks) {
private void processLoadedTasksOnDesktop(List<GroupTask> tasks) {
// Find the single desktop task that contains a grouping of desktop tasks
DesktopTask desktopTask = findDesktopTask(tasks);
@@ -173,7 +173,7 @@ public final class KeyboardQuickSwitchController implements
}
@Nullable
private DesktopTask findDesktopTask(ArrayList<GroupTask> tasks) {
private DesktopTask findDesktopTask(List<GroupTask> tasks) {
return (DesktopTask) tasks.stream()
.filter(t -> t instanceof DesktopTask)
.findFirst()