Merge "Launcher: Make RecentTasksController.getRecentTasks() multi-desks aware" into main

This commit is contained in:
Treehugger Robot
2025-02-21 10:38:35 -08:00
committed by Android (Google) Code Review
2 changed files with 8 additions and 7 deletions
@@ -21,7 +21,7 @@ import static android.content.Intent.FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS;
import static com.android.launcher3.Flags.enableSeparateExternalDisplayTasks;
import static com.android.launcher3.util.Executors.UI_HELPER_EXECUTOR;
import static com.android.quickstep.util.SplitScreenUtils.convertShellSplitBoundsToLauncher;
import static com.android.wm.shell.shared.GroupedTaskInfo.TYPE_FREEFORM;
import static com.android.wm.shell.shared.GroupedTaskInfo.TYPE_DESK;
import static com.android.wm.shell.shared.GroupedTaskInfo.TYPE_SPLIT;
import android.app.ActivityManager.RunningTaskInfo;
@@ -353,7 +353,7 @@ public class RecentTasksList {
int numVisibleTasks = 0;
for (GroupedTaskInfo rawTask : rawTasks) {
if (rawTask.isBaseType(TYPE_FREEFORM)) {
if (rawTask.isBaseType(TYPE_DESK)) {
// TYPE_FREEFORM tasks is only created when desktop mode can be entered,
// leftover TYPE_FREEFORM tasks created when flag was on should be ignored.
if (DesktopModeStatus.canEnterDesktopMode(mContext)) {
@@ -177,8 +177,8 @@ public class RecentTasksListTest {
createRecentTaskInfo(4 /* taskId */, DEFAULT_DISPLAY),
createRecentTaskInfo(5 /* taskId */, 1 /* displayId */),
createRecentTaskInfo(6 /* taskId */, 1 /* displayId */));
GroupedTaskInfo recentTaskInfos = GroupedTaskInfo.forFreeformTasks(
tasks, Collections.emptySet() /* minimizedTaskIds */);
GroupedTaskInfo recentTaskInfos = GroupedTaskInfo.forDeskTasks(
0 /* deskId */, tasks, Collections.emptySet() /* minimizedTaskIds */);
when(mSystemUiProxy.getRecentTasks(anyInt(), anyInt()))
.thenReturn(new ArrayList<>(Collections.singletonList(recentTaskInfos)));
@@ -207,8 +207,8 @@ public class RecentTasksListTest {
createRecentTaskInfo(4 /* taskId */, DEFAULT_DISPLAY),
createRecentTaskInfo(5 /* taskId */, 1 /* displayId */),
createRecentTaskInfo(6 /* taskId */, 1 /* displayId */));
GroupedTaskInfo recentTaskInfos = GroupedTaskInfo.forFreeformTasks(
tasks, Collections.emptySet() /* minimizedTaskIds */);
GroupedTaskInfo recentTaskInfos = GroupedTaskInfo.forDeskTasks(
0 /* deskId */, tasks, Collections.emptySet() /* minimizedTaskIds */);
when(mSystemUiProxy.getRecentTasks(anyInt(), anyInt()))
.thenReturn(new ArrayList<>(Collections.singletonList(recentTaskInfos)));
@@ -241,7 +241,8 @@ public class RecentTasksListTest {
createRecentTaskInfo(5 /* taskId */, DEFAULT_DISPLAY));
Set<Integer> minimizedTaskIds =
Arrays.stream(new Integer[]{1, 4, 5}).collect(Collectors.toSet());
GroupedTaskInfo recentTaskInfos = GroupedTaskInfo.forFreeformTasks(tasks, minimizedTaskIds);
GroupedTaskInfo recentTaskInfos = GroupedTaskInfo.forDeskTasks(
0 /* deskId */, tasks, minimizedTaskIds);
when(mSystemUiProxy.getRecentTasks(anyInt(), anyInt()))
.thenReturn(new ArrayList<>(Collections.singletonList(recentTaskInfos)));