Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f107c9ef authored by Winson Chung's avatar Winson Chung
Browse files

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
parent d4dc9545
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -143,8 +143,8 @@ public class RecentsModel extends TaskStackChangeListener {
        }

        // Keep the cache up to date with the latest thumbnails
        mTaskList.getTasks(mThumbnailCache.getCacheSize(), true /* keysOnly */, (tasks) -> {
        int runningTaskId = RecentsModel.getRunningTaskId();
        mTaskList.getTasks(mThumbnailCache.getCacheSize(), true /* keysOnly */, (tasks) -> {
            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
+3 −2
Original line number Diff line number Diff line
@@ -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);
        });
    }