Finally remove task1 and task2 from GroupTask

See go/refactor-group-task for details. This is the final CL
in this refactor, where `task1` and `task2` are finally removed,
and `DesktopTask` is allowed to have empty tasks.

Bug: 388593902
Test: m
Flag: EXEMPT pure refactor with no behavior change.
Change-Id: I8af39b58138f11030981311efc2e95a77cef125b
This commit is contained in:
Ahmed Fakhry
2025-01-28 22:11:18 +00:00
parent c590a62c80
commit 129a3a0097
3 changed files with 16 additions and 44 deletions
@@ -26,8 +26,6 @@ import static com.android.launcher3.LauncherSettings.Favorites.ITEM_TYPE_FOLDER;
import static com.android.launcher3.config.FeatureFlags.enableTaskbarPinning;
import static com.android.launcher3.icons.IconNormalizer.ICON_VISIBLE_AREA_FACTOR;
import static java.util.function.Predicate.not;
import android.content.Context;
import android.content.res.Resources;
import android.graphics.Canvas;
@@ -420,7 +418,7 @@ public class TaskbarView extends FrameLayout implements FolderIcon.FolderIconPar
.filter(Objects::nonNull)
.toArray(ItemInfo[]::new);
// TODO(b/343289567 and b/316004172): support app pairs and desktop mode.
recentTasks = recentTasks.stream().filter(not(GroupTask::supportsMultipleTasks)).toList();
recentTasks = recentTasks.stream().filter(it -> it instanceof SingleTask).toList();
if (taskbarRecentsLayoutTransition()) {
updateItemsWithLayoutTransition(hotseatItemInfos, recentTasks);
@@ -671,7 +669,7 @@ public class TaskbarView extends FrameLayout implements FolderIcon.FolderIconPar
// Replace any Recent views with the appropriate type if it's not already that type.
final int expectedLayoutResId;
boolean isCollection = false;
if (task.supportsMultipleTasks()) {
if (!(task instanceof SingleTask)) {
if (task.taskViewType == TaskViewType.DESKTOP) {
// TODO(b/316004172): use Desktop tile layout.
expectedLayoutResId = -1;