mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-03-04 18:06:48 +00:00
Fix RecentTasksList change id incrementing
The change id in RecentTasksList would never actually increment as we never register it as a TaskStackListener. As a result, we always execute the result callback immediately when getting a task and the task list is always valid. In addition, when the list IS up to date, we still fetch the list again in the background when we should instead just return early. This CL addresses both of these issues. Test: Added logs to see that task loading wasn't happening when lists are the same Change-Id: I228f8d7cd3cb22ef88d71e1bee40708c2bcf26d6
This commit is contained in:
@@ -60,6 +60,7 @@ public class RecentTasksList extends TaskStackChangeListener {
|
||||
mBgThreadExecutor = BackgroundExecutor.get();
|
||||
mKeyguardManager = new KeyguardManagerCompat(context);
|
||||
mChangeId = 1;
|
||||
ActivityManagerWrapper.getInstance().registerTaskStackListener(this);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -97,6 +98,7 @@ public class RecentTasksList extends TaskStackChangeListener {
|
||||
if (mLastLoadedId == mChangeId && (!mLastLoadHadKeysOnly || loadKeysOnly)) {
|
||||
// The list is up to date, callback with the same list
|
||||
mMainThreadExecutor.execute(resultCallback);
|
||||
return requestLoadId;
|
||||
}
|
||||
|
||||
// Kick off task loading in the background
|
||||
|
||||
Reference in New Issue
Block a user