Revert "Revert "Synchronizing loader preload to avoid launcher getting stuck in loading state,""
This reverts commit 73aa3025c0
.
Reason for revert: Post-drop revert
Change-Id: Ife752d26e07d9c064c938ff8d33d40457b54217a
This commit is contained in:
parent
73aa3025c0
commit
d6519668bf
|
@ -493,6 +493,15 @@ public class LauncherModel extends BroadcastReceiver
|
|||
}
|
||||
}
|
||||
|
||||
public void startLoaderForResultsIfNotLoaded(LoaderResults results) {
|
||||
synchronized (mLock) {
|
||||
if (!isModelLoaded()) {
|
||||
Log.d(TAG, "Workspace not loaded, loading now");
|
||||
startLoaderForResults(results);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Loads the workspace screen ids in an ordered list.
|
||||
*/
|
||||
|
|
|
@ -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());
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue