Merge "Fixing issue with removing tasks immediately after boot" into ub-launcher3-rvc-dev

This commit is contained in:
TreeHugger Robot
2020-04-14 21:46:23 +00:00
committed by Android (Google) Code Review
@@ -123,6 +123,17 @@ public class RecentTasksList extends TaskStackChangeListener {
mChangeId++;
}
@Override
public void onRecentTaskListUpdated() {
// In some cases immediately after booting, the tasks in the system recent task list may be
// loaded, but not in the active task hierarchy in the system. These tasks are displayed in
// overview, but removing them don't result in a onTaskStackChanged() nor a onTaskRemoved()
// callback (those are for changes to the active tasks), but the task list is still updated,
// so we should also invalidate the change id to ensure we load a new list instead of
// reusing a stale list.
mChangeId++;
}
@Override
public void onTaskRemoved(int taskId) {
mTasks = loadTasksInBackground(Integer.MAX_VALUE, false);