Add TasksRepository

Bug: 334825222
Test: TasksRepositoryTest
Flag: com.android.launcher3.enable_refactor_task_thumbnail
Change-Id: I3e08dea7b205df54f8bef456ead6466aa2ce45c6
This commit is contained in:
Uwais Ashraf committed 2024-05-24 12:06:59 +00:00
1 parent e21d6b15d5
commit f6f34ca441
15 files changed
+456 -25

No files matched your search

@@ -31,6 +31,7 @@ import android.os.Process;
import android.os.RemoteException;
import android.util.SparseBooleanArray;
import androidx.annotation.Nullable;
import androidx.annotation.VisibleForTesting;
import com.android.launcher3.util.LooperExecutor;
@@ -44,6 +45,7 @@ import com.android.wm.shell.util.GroupedRecentTaskInfo;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.function.Consumer;
import java.util.function.Predicate;
import java.util.stream.Collectors;
@@ -137,7 +139,7 @@ public class RecentTasksList {
* @return The change id of the current task list
*/
public synchronized int getTasks(boolean loadKeysOnly,
Consumer<ArrayList<GroupTask>> callback, Predicate<GroupTask> filter) {
@Nullable Consumer<List<GroupTask>> callback, Predicate<GroupTask> filter) {
final int requestLoadId = mChangeId;
if (mResultsUi.isValidForRequest(requestLoadId, loadKeysOnly)) {
// The list is up to date, send the callback on the next frame,