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

Commit fad38234 authored by Winson Chung's avatar Winson Chung Committed by Android (Google) Code Review
Browse files

Merge "Clean up some more refs to thumbnail data" into ub-launcher3-qt-dev

parents 3a6eedc6 df9fc63e
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -368,6 +368,9 @@ public class TaskView extends FrameLayout implements PageCallbacks, Reusable {
        } else {
            mSnapshotView.setThumbnail(null, null);
            setIcon(null);
            // Reset the task thumbnail reference as well (it will be fetched from the cache or
            // reloaded next time we need it)
            mTask.thumbnail = null;
        }
    }

@@ -488,9 +491,6 @@ public class TaskView extends FrameLayout implements PageCallbacks, Reusable {
        mSnapshotView.setThumbnail(mTask, null);
        setOverlayEnabled(false);
        onTaskListVisibilityChanged(false);
        if (mTask != null) {
            mTask.thumbnail = null;
        }
    }

    @Override
+11 −1
Original line number Diff line number Diff line
@@ -84,7 +84,7 @@ public class RecentTasksList extends TaskStackChangeListener {
        final int requestLoadId = mChangeId;
        Runnable resultCallback = callback == null
                ? () -> { }
                : () -> callback.accept(mTasks);
                : () -> callback.accept(copyOf(mTasks));

        if (mLastLoadedId == mChangeId && (!mLastLoadHadKeysOnly || loadKeysOnly)) {
            // The list is up to date, callback with the same list
@@ -183,4 +183,14 @@ public class RecentTasksList extends TaskStackChangeListener {

        return allTasks;
    }

    private ArrayList<Task> copyOf(ArrayList<Task> tasks) {
        ArrayList<Task> newTasks = new ArrayList<>();
        for (int i = 0; i < tasks.size(); i++) {
            Task t = tasks.get(i);
            newTasks.add(new Task(t.key, t.colorPrimary, t.colorBackground, t.isDockable,
                    t.isLocked, t.taskDescription, t.topActivity));
        }
        return newTasks;
    }
}
 No newline at end of file