Merge "Clean up some more refs to thumbnail data" into ub-launcher3-qt-dev
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user