Don't return TYPE_RECENTS task in TopTaskTracker.getCachedTopTask
- We have no use-case to show TYPE_RECENTS (NexusLauncher or RecentsActivity) in Overview, stripping TYPE_RECENTS avoids accidentally showing RecentsAcitivty as a tile on swipe up
Fix: 355263037
Test: manually verify it doesn't break 3P Launcher; the bug itself cannot be verified as it cannot be easily reproduced
Flag: EXEMPT BUG_FIX
Change-Id: Id1b8e43dc7ddb9ad9c781b9a860fe4fba97d4be6
diff --git a/quickstep/src/com/android/quickstep/TopTaskTracker.java b/quickstep/src/com/android/quickstep/TopTaskTracker.java
index 3cf0542..23a1ec7 100644
--- a/quickstep/src/com/android/quickstep/TopTaskTracker.java
+++ b/quickstep/src/com/android/quickstep/TopTaskTracker.java
@@ -206,12 +206,17 @@
Collections.addAll(mOrderedTaskList, tasks);
}
- // Strip the pinned task
ArrayList<RunningTaskInfo> tasks = new ArrayList<>(mOrderedTaskList);
- tasks.removeIf(t -> t.taskId == mPinnedTaskId);
+ // Strip the pinned task and recents task
+ tasks.removeIf(t -> t.taskId == mPinnedTaskId || isRecentsTask(t));
return new CachedTaskInfo(tasks);
}
+ private static boolean isRecentsTask(RunningTaskInfo task) {
+ return task != null && task.configuration.windowConfiguration
+ .getActivityType() == ACTIVITY_TYPE_RECENTS;
+ }
+
/**
* Class to provide information about a task which can be safely cached and do not change
* during the lifecycle of the task.
@@ -267,8 +272,7 @@
}
public boolean isRecentsTask() {
- return mTopTask != null && mTopTask.configuration.windowConfiguration
- .getActivityType() == ACTIVITY_TYPE_RECENTS;
+ return TopTaskTracker.isRecentsTask(mTopTask);
}
/**