am f5cd998c: Starting the loader if the previous loader is not complete, instead of binding page synchronously

* commit 'f5cd998c25b025e46c56f4e862f4f5573a807745':
  Starting the loader if the previous loader is not complete, instead of binding page synchronously
This commit is contained in:
Sunny Goyal
2015-05-18 22:54:21 +00:00
committed by Android Git Automerger
+10 -2
View File
@@ -1390,10 +1390,10 @@ public class LauncherModel extends BroadcastReceiver
if (mCallbacks != null && mCallbacks.get() != null) {
// If there is already one running, tell it to stop.
// also, don't downgrade isLaunching if we're already running
isLaunching = isLaunching || stopLoaderLocked();
isLaunching = stopLoaderLocked() || isLaunching;
mLoaderTask = new LoaderTask(mApp.getContext(), isLaunching, loadFlags);
if (synchronousBindPage != PagedView.INVALID_RESTORE_PAGE
&& mAllAppsLoaded && mWorkspaceLoaded) {
&& mAllAppsLoaded && mWorkspaceLoaded && !mIsLoaderTaskRunning) {
mLoaderTask.runBindSynchronousPage(synchronousBindPage);
} else {
sWorkerThread.setPriority(Thread.NORM_PRIORITY);
@@ -1600,6 +1600,9 @@ public class LauncherModel extends BroadcastReceiver
public void run() {
synchronized (mLock) {
if (mStopped) {
return;
}
mIsLoaderTaskRunning = true;
}
// Optimize for end-user experience: if the Launcher is up and // running with the
@@ -2783,6 +2786,11 @@ public class LauncherModel extends BroadcastReceiver
}
if (!mAllAppsLoaded) {
loadAllApps();
synchronized (LoaderTask.this) {
if (mStopped) {
return;
}
}
updateAllAppsIconsCache();
synchronized (LoaderTask.this) {
if (mStopped) {