Set up a place holder tile for desktop

Create a placeholder tile in recents for desktop.
It is based on launcher task information. With extra flag indicating it
is for desktop.
When it is clicked, it will call sysui to show apps on desktop.

Test: manually verify that desktop tasks do not show up separately in
recents
Bug: 244348395

Change-Id: I8535a54e1545841cd988d4770e6fc5e857277cda
This commit is contained in:
Ats Jenk committed 2022-09-23 16:28:48 -07:00
1 parent d859a20086
commit 919ddf19f3
4 files changed
+43 -4

No files matched your search

@@ -255,7 +255,8 @@ public class RecentTasksList {
TaskLoadResult allTasks = new TaskLoadResult(requestId, loadKeysOnly, rawTasks.size());
for (GroupedRecentTaskInfo rawTask : rawTasks) {
if (rawTask.getType() == GroupedRecentTaskInfo.TYPE_FREEFORM) {
// TODO: add entry for freeform tasks
GroupTask desktopTask = createDesktopTask(rawTask);
allTasks.add(desktopTask);
continue;
}
ActivityManager.RecentTaskInfo taskInfo1 = rawTask.getTaskInfo1();
@@ -283,6 +284,16 @@ public class RecentTasksList {
return allTasks;
}
private GroupTask createDesktopTask(GroupedRecentTaskInfo taskInfo) {
// TODO(b/244348395): create a subclass of GroupTask for desktop tile
// We need a single task information as the primary task. Use the first task
Task.TaskKey key = new Task.TaskKey(taskInfo.getTaskInfo1());
Task task = new Task(key);
task.desktopTile = true;
task.topActivity = key.sourceComponent;
return new GroupTask(task, null, null);
}
private SplitConfigurationOptions.SplitBounds convertSplitBounds(
SplitBounds shellSplitBounds) {
return shellSplitBounds == null ?