Fix gestures for exclude-from-recents + translucent tasks

- If task is translucent and excluded, fade out as swipe up
  - Fade back in when re-launching live tile
- Ignore excluded tasks if there is another visible task,
  and use that underlying task during gesture instead.

Fixes: 299351175
Fixes: 300297333
Fixes: 302672319

Test: Invoke translucent + excluded app (e.g. expanded Volume
dialog) over another app, swipe to overview, quick switch, home

Change-Id: I5740afc4bf561d1a264bd132863ffc15f27d2b20
This commit is contained in:
Tony Wickham committed 2023-10-04 20:23:07 +00:00
1 parent bcac59d6ea
commit 94a0a58b37
6 files changed
+55 -24

No files matched your search

@@ -16,6 +16,8 @@
package com.android.quickstep;
import static android.content.Intent.FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS;
import static com.android.launcher3.util.Executors.UI_HELPER_EXECUTOR;
import static com.android.quickstep.views.DesktopTaskView.DESKTOP_IS_PROTO2_ENABLED;
import static com.android.wm.shell.util.GroupedRecentTaskInfo.TYPE_FREEFORM;
@@ -269,6 +271,7 @@ public class RecentTasksList {
TaskLoadResult allTasks = new TaskLoadResult(requestId, loadKeysOnly, rawTasks.size());
int numVisibleTasks = 0;
for (GroupedRecentTaskInfo rawTask : rawTasks) {
if (DESKTOP_IS_PROTO2_ENABLED && rawTask.getType() == TYPE_FREEFORM) {
GroupTask desktopTask = createDesktopTask(rawTask);
@@ -285,12 +288,27 @@ public class RecentTasksList {
task1.setLastSnapshotData(taskInfo1);
Task task2 = null;
if (taskInfo2 != null) {
// Is split task
Task.TaskKey task2Key = new Task.TaskKey(taskInfo2);
task2 = loadKeysOnly
? new Task(task2Key)
: Task.from(task2Key, taskInfo2,
tmpLockedUsers.get(task2Key.userId) /* isLocked */);
task2.setLastSnapshotData(taskInfo2);
} else {
// Is fullscreen task
if (numVisibleTasks > 0) {
boolean isExcluded = (taskInfo1.baseIntent.getFlags()
& FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS) != 0;
if (taskInfo1.isTopActivityTransparent && isExcluded) {
// If there are already visible tasks, then ignore the excluded tasks and
// don't add them to the returned list
continue;
}
}
}
if (taskInfo1.isVisible) {
numVisibleTasks++;
}
final SplitConfigurationOptions.SplitBounds launcherSplitBounds =
convertSplitBounds(rawTask.getSplitBounds());