mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-03-04 18:06:48 +00:00
Synchronizing loader preload to avoid launcher getting stuck in loading state,
which could be caused by the following sequence of events
1) Starts preload => execution moved to background thread
a) check if loader is running
... execution moved to ui thread
2) Launcher starts
3) Cancels any running loader and starts a new loader
.... Execution on background thread
b) Cancels any running loader and starts a new loader
Synchronizing (3), and [a, b] under same lock would avoid this case
Bug: 73399920
Change-Id: I6b01f797fd6f4a2e5b3c078bb374ad40fcc311c8
This commit is contained in:
@@ -49,11 +49,8 @@ public class ModelPreload implements ModelUpdateTask {
|
||||
|
||||
@Override
|
||||
public final void run() {
|
||||
if (!mModel.isModelLoaded()) {
|
||||
Log.d(TAG, "Workspace not loaded, loading now");
|
||||
mModel.startLoaderForResults(
|
||||
new LoaderResults(mApp, mBgDataModel, mAllAppsList, 0, null));
|
||||
}
|
||||
mModel.startLoaderForResultsIfNotLoaded(
|
||||
new LoaderResults(mApp, mBgDataModel, mAllAppsList, 0, null));
|
||||
Log.d(TAG, "Preload completed : " + mModel.isModelLoaded());
|
||||
onComplete(mModel.isModelLoaded());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user