4b/ Migrate TopTaskTracker to use visible running tasks from Shell
- When enable_shell_top_task_tracking is enabled, use the shell provided signals to keep an up-to-date running (visible) task list on the Launcher side, instead of managing the list via to-front signals from Core via TaskStackListener. In doing so, we also update CachedTaskInfo to use this visible task list in preparation for future refactoring to use the GroupedTaskInfos directly instead. Bug: 346588978 Flag: EXEMPT adding new flag enable_shell_top_task_tracking Test: Build SystemUI & Launcher Test: atest WMShellUnitTests Change-Id: I16d515243760a17258a727e2502e35387da87589
This commit is contained in:
1 parent
ba81c0f345
commit
dde53a10e3
9 files changed
+392
-122
No files matched your search
@@ -114,12 +114,9 @@ public class RecentTasksList {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onTaskMovedToFront(GroupedTaskInfo[] visibleTasks) {
|
||||
public void onTaskMovedToFront(GroupedTaskInfo taskToFront) {
|
||||
mMainThreadExecutor.execute(() -> {
|
||||
// TODO(b/346588978): We currently are only sending a single task, but this will
|
||||
// be updated once we send the full set of visible tasks
|
||||
final TaskInfo info = visibleTasks[0].getTaskInfo1();
|
||||
topTaskTracker.handleTaskMovedToFront(info);
|
||||
topTaskTracker.handleTaskMovedToFront(taskToFront.getTaskInfo1());
|
||||
});
|
||||
}
|
||||
|
||||
@@ -127,6 +124,13 @@ public class RecentTasksList {
|
||||
public void onTaskInfoChanged(RunningTaskInfo taskInfo) {
|
||||
mMainThreadExecutor.execute(() -> topTaskTracker.onTaskChanged(taskInfo));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onVisibleTasksChanged(GroupedTaskInfo[] visibleTasks) {
|
||||
mMainThreadExecutor.execute(() -> {
|
||||
topTaskTracker.onVisibleTasksChanged(visibleTasks);
|
||||
});
|
||||
}
|
||||
});
|
||||
// We may receive onRunningTaskAppeared events later for tasks which have already been
|
||||
// included in the list returned by mSysUiProxy.getRunningTasks(), or may receive
|
||||
|
||||
Reference in new issue
Block a user