Reload task list when task is removed
Instead of individually removing tasks,
ask for all tasks to get accurate list.
This method is invoked whenever user presses
back on a root activity, which causes the task to
be killed from perspective of the activity.
Test: Visually inspected, recent task no longer
disappears.
Open any app, hit back, and then go to overview quickly.
App should remain in recents list.
Fixes: 135687618
Change-Id: I1c135673ae987016db5df0b83f5ea8e345d3c7c1
(cherry picked from commit 8651219f7e41beee312b206eb543f35166d588f1)
diff --git a/quickstep/src/com/android/quickstep/RecentTasksList.java b/quickstep/src/com/android/quickstep/RecentTasksList.java
index d807b89..e41dba9 100644
--- a/quickstep/src/com/android/quickstep/RecentTasksList.java
+++ b/quickstep/src/com/android/quickstep/RecentTasksList.java
@@ -119,12 +119,7 @@
@Override
public void onTaskRemoved(int taskId) {
- for (int i = mTasks.size() - 1; i >= 0; i--) {
- if (mTasks.get(i).key.id == taskId) {
- mTasks.remove(i);
- return;
- }
- }
+ mTasks = loadTasksInBackground(Integer.MAX_VALUE, false);
}
@Override