Clean-up unnecessary desktop windowing flag usage

- mDesktopVisibilityController will now be null if desktop windowing flag is disabled
- As a result, all code that uses mDesktopVisibilityController no longer need to check desktop windowing flag
- DesktopTaskView/DesktopTask only populates when flag is enabled, so we don't need to check flag if we already check DesktopTaskView/DesktopTask
- Removed the flag check in SplitToWorkspaceController, as we shouldn't enable split from workspace base on desktop windowing, contextual split already have its own flag
- Also avoid creating GroupTask or DesktopTask for freeform tasks when flag is off, to avoid a crash in RecentsView

Bug: 332655617
Test: manual with desktop windowing flag on/off
Flag: ACONFIG com.android.window.flags.enable_desktop_windowing_mode DEVELOPMENT
Change-Id: I0e45f73ad2b0d99dfb4ec3215f973679ca93957c
This commit is contained in:
Alex Chau committed 2024-04-04 12:21:43 +01:00
1 parent 75e48fc0ec
commit 13b7ceeff0
15 files changed
+67 -120

No files matched your search

@@ -270,9 +270,13 @@ public class RecentTasksList {
int numVisibleTasks = 0;
for (GroupedRecentTaskInfo rawTask : rawTasks) {
if (enableDesktopWindowingMode() && rawTask.getType() == TYPE_FREEFORM) {
GroupTask desktopTask = createDesktopTask(rawTask);
allTasks.add(desktopTask);
if (rawTask.getType() == TYPE_FREEFORM) {
// TYPE_FREEFORM tasks is only created when enableDesktopWindowingMode() is true,
// leftover TYPE_FREEFORM tasks created when flag was on should be ignored.
if (enableDesktopWindowingMode()) {
GroupTask desktopTask = createDesktopTask(rawTask);
allTasks.add(desktopTask);
}
continue;
}
ActivityManager.RecentTaskInfo taskInfo1 = rawTask.getTaskInfo1();