Starting the loader if the previous loader is not complete, instead of binding page synchronously
Bug: 21107637 Change-Id: If04952c7d5c8a38a739ce5536ecac394011ab61a
This commit is contained in:
@@ -1390,10 +1390,10 @@ public class LauncherModel extends BroadcastReceiver
|
|||||||
if (mCallbacks != null && mCallbacks.get() != null) {
|
if (mCallbacks != null && mCallbacks.get() != null) {
|
||||||
// If there is already one running, tell it to stop.
|
// If there is already one running, tell it to stop.
|
||||||
// also, don't downgrade isLaunching if we're already running
|
// also, don't downgrade isLaunching if we're already running
|
||||||
isLaunching = isLaunching || stopLoaderLocked();
|
isLaunching = stopLoaderLocked() || isLaunching;
|
||||||
mLoaderTask = new LoaderTask(mApp.getContext(), isLaunching, loadFlags);
|
mLoaderTask = new LoaderTask(mApp.getContext(), isLaunching, loadFlags);
|
||||||
if (synchronousBindPage != PagedView.INVALID_RESTORE_PAGE
|
if (synchronousBindPage != PagedView.INVALID_RESTORE_PAGE
|
||||||
&& mAllAppsLoaded && mWorkspaceLoaded) {
|
&& mAllAppsLoaded && mWorkspaceLoaded && !mIsLoaderTaskRunning) {
|
||||||
mLoaderTask.runBindSynchronousPage(synchronousBindPage);
|
mLoaderTask.runBindSynchronousPage(synchronousBindPage);
|
||||||
} else {
|
} else {
|
||||||
sWorkerThread.setPriority(Thread.NORM_PRIORITY);
|
sWorkerThread.setPriority(Thread.NORM_PRIORITY);
|
||||||
@@ -1600,6 +1600,9 @@ public class LauncherModel extends BroadcastReceiver
|
|||||||
|
|
||||||
public void run() {
|
public void run() {
|
||||||
synchronized (mLock) {
|
synchronized (mLock) {
|
||||||
|
if (mStopped) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
mIsLoaderTaskRunning = true;
|
mIsLoaderTaskRunning = true;
|
||||||
}
|
}
|
||||||
// Optimize for end-user experience: if the Launcher is up and // running with the
|
// 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) {
|
if (!mAllAppsLoaded) {
|
||||||
loadAllApps();
|
loadAllApps();
|
||||||
|
synchronized (LoaderTask.this) {
|
||||||
|
if (mStopped) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
updateAllAppsIconsCache();
|
updateAllAppsIconsCache();
|
||||||
synchronized (LoaderTask.this) {
|
synchronized (LoaderTask.this) {
|
||||||
if (mStopped) {
|
if (mStopped) {
|
||||||
|
|||||||
Reference in New Issue
Block a user