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:
parent
d4dc9545c3
commit
f107c9ef6d
|
@ -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
|
||||
|
|
|
@ -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);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue