Merge "Fix filtering of DesktopTaskViews" into main

This commit is contained in:
Treehugger Robot
2024-08-01 12:29:09 +00:00
committed by Android (Google) Code Review
2 changed files with 11 additions and 12 deletions
@@ -145,6 +145,7 @@ import com.android.quickstep.RecentsModel;
import com.android.quickstep.SystemUiProxy;
import com.android.quickstep.util.DesktopTask;
import com.android.quickstep.util.GroupTask;
import com.android.quickstep.views.DesktopTaskView;
import com.android.quickstep.views.RecentsView;
import com.android.quickstep.views.TaskView;
import com.android.systemui.shared.recents.model.Task;
@@ -1412,7 +1413,8 @@ public class TaskbarActivityContext extends BaseTaskbarContext {
if (foundTask != null) {
TaskView foundTaskView = recents.getTaskViewByTaskId(foundTask.key.id);
if (foundTaskView != null
&& foundTaskView.isVisibleToUser()) {
&& foundTaskView.isVisibleToUser()
&& !(foundTaskView instanceof DesktopTaskView)) {
TestLogging.recordEvent(
TestProtocol.SEQUENCE_MAIN, "start: taskbarAppIcon");
foundTaskView.launchTasks();
@@ -1463,7 +1465,6 @@ public class TaskbarActivityContext extends BaseTaskbarContext {
return;
}
}
startActivity(intent);
} else {
getSystemService(LauncherApps.class).startMainActivity(
@@ -276,17 +276,15 @@ public class SplitSelectStateController {
// Loop through tasks in reverse, since they are ordered with recent tasks last
for (int j = taskGroups.size() - 1; j >= 0; j--) {
GroupTask groupTask = taskGroups.get(j);
Task task1 = groupTask.task1;
// Don't add duplicate Tasks
if (isInstanceOfComponent(task1, key)
&& !Arrays.asList(lastActiveTasks).contains(task1)) {
lastActiveTask = task1;
break;
// Account for desktop cases where there can be N tasks in the group
for (Task task : groupTask.getTasks()) {
if (isInstanceOfComponent(task, key)
&& !Arrays.asList(lastActiveTasks).contains(task)) {
lastActiveTask = task;
break;
}
}
Task task2 = groupTask.task2;
if (isInstanceOfComponent(task2, key)
&& !Arrays.asList(lastActiveTasks).contains(task2)) {
lastActiveTask = task2;
if (lastActiveTask != null) {
break;
}
}