Fixing regression in background task loading.

Bug: 117603579
Test: Take systrace, ensure that we aren't loading thumbnails on the UI
      thread

Change-Id: I4b522246a5ab12dc37c1dffdccd05232bbc1f6fe
This commit is contained in:
Winson Chung committed 2018-10-29 10:51:10 -07:00
1 parent d4dc9545c3
commit f107c9ef6d
2 files changed
+4 -3

No files matched your search

@@ -143,8 +143,8 @@ public class RecentsModel extends TaskStackChangeListener {
}
// Keep the cache up to date with the latest thumbnails
int runningTaskId = RecentsModel.getRunningTaskId();
mTaskList.getTasks(mThumbnailCache.getCacheSize(), true /* keysOnly */, (tasks) -> {
int runningTaskId = RecentsModel.getRunningTaskId();
for (Task task : tasks) {
if (task.key.id == runningTaskId) {
// Skip the running task, it's not going to have an up-to-date snapshot by the