diff --git a/quickstep/src/com/android/quickstep/RecentsModel.java b/quickstep/src/com/android/quickstep/RecentsModel.java index e184a9bb18..2e4d4d2b83 100644 --- a/quickstep/src/com/android/quickstep/RecentsModel.java +++ b/quickstep/src/com/android/quickstep/RecentsModel.java @@ -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 diff --git a/quickstep/src/com/android/quickstep/TaskThumbnailCache.java b/quickstep/src/com/android/quickstep/TaskThumbnailCache.java index c47101b827..61a191f3fa 100644 --- a/quickstep/src/com/android/quickstep/TaskThumbnailCache.java +++ b/quickstep/src/com/android/quickstep/TaskThumbnailCache.java @@ -108,8 +108,9 @@ public class TaskThumbnailCache { Preconditions.assertUIThread(); // Fetch the thumbnail for this task and put it in the cache - mCache.put(task.key, ActivityManagerWrapper.getInstance().getTaskThumbnail( - task.key.id, true /* reducedResolution */)); + updateThumbnailInBackground(task, true /* reducedResolution */, (t) -> { + mCache.put(task.key, t.thumbnail); + }); }