Fixing task cache was incorrectly set when partial list was requested

Change-Id: Ic3ef49930e38b6a66a2871baada122f81865644f
This commit is contained in:
Sunny Goyal committed 2019-01-03 15:15:58 -08:00
1 parent 161a214ede
commit 2f979d2639
2 files changed
+29 -22

No files matched your search

@@ -98,7 +98,7 @@ public class RecentsModel extends TaskStackChangeListener {
* @return the request id associated with this call.
*/
public int getTasks(Consumer<ArrayList<Task>> callback) {
return mTaskList.getTasks(-1, false /* loadKeysOnly */, callback);
return mTaskList.getTasks(false /* loadKeysOnly */, callback);
}
/**
@@ -124,7 +124,7 @@ public class RecentsModel extends TaskStackChangeListener {
* called on the UI thread.
*/
public void findTaskWithId(int taskId, Consumer<Task.TaskKey> callback) {
mTaskList.getTasks(-1, true /* loadKeysOnly */, (tasks) -> {
mTaskList.getTasks(true /* loadKeysOnly */, (tasks) -> {
for (Task task : tasks) {
if (task.key.id == taskId) {
callback.accept(task.key);
@@ -150,7 +150,7 @@ 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) -> {
mTaskList.getTaskKeys(mThumbnailCache.getCacheSize(), 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