Add listener to update taskInfo when task change via transition

This change ensures the task information in TopTaskTracker stays updated with any task modifications. For instance, switching a task between freeform windowing and fullscreen will now update in TopTaskTracker, and consequently, in the RecentTasksList used by RecentsModel and RecentsView. This resolves a previous bug where switching a freeform task to fullscreen wasn't reflected, causing the new Fullscreen task and an incorrect DesktopTask state to display in the Overview.

Fix: 356355595
Flag: com.android.window.flags.enable_task_stack_observer_in_shell
Test: Manual.
Change-Id: Ib4a6eb8ea6abd21903018b05186c516511526746
This commit is contained in:
Jordan Silva committed 2024-10-31 16:29:34 +00:00
1 parent 972531f529
commit 2627657ab6
2 files changed
+14

No files matched your search

@@ -119,6 +119,11 @@ public class RecentTasksList {
topTaskTracker.onTaskMovedToFront(taskInfo);
});
}
@Override
public void onTaskInfoChanged(ActivityManager.RunningTaskInfo taskInfo) {
mMainThreadExecutor.execute(() -> topTaskTracker.onTaskChanged(taskInfo));
}
});
// We may receive onRunningTaskAppeared events later for tasks which have already been
// included in the list returned by mSysUiProxy.getRunningTasks(), or may receive