Loading src/com/android/launcher3/Launcher.java +2 −2 Original line number Diff line number Diff line Loading @@ -456,7 +456,7 @@ public class Launcher extends Activity if (DISABLE_SYNCHRONOUS_BINDING_CURRENT_PAGE || sPausedFromUserAction) { // If the user leaves launcher, then we should just load items asynchronously when // they return. mModel.startLoader(true, -1); mModel.startLoader(true, PagedView.INVALID_RESTORE_PAGE); } else { // We only load the page synchronously if the user rotates (or triggers a // configuration change) while launcher is in the foreground Loading Loading @@ -914,7 +914,7 @@ public class Launcher extends Activity sPausedFromUserAction = false; if (mRestoring || mOnResumeNeedsLoad) { mWorkspaceLoading = true; mModel.startLoader(true, -1); mModel.startLoader(true, PagedView.INVALID_RESTORE_PAGE); mRestoring = false; mOnResumeNeedsLoad = false; } Loading src/com/android/launcher3/LauncherModel.java +11 −8 Original line number Diff line number Diff line Loading @@ -75,6 +75,7 @@ public class LauncherModel extends BroadcastReceiver { public static final boolean UPGRADE_USE_MORE_APPS_FOLDER = false; private static final int ITEMS_CHUNK = 6; // batch size for the workspace icons private static final long INVALID_SCREEN_ID = -1L; private final boolean mAppsCanBeOnRemoveableStorage; private final LauncherAppState mApp; Loading Loading @@ -1158,7 +1159,7 @@ public class LauncherModel extends BroadcastReceiver { } } if (runLoader) { startLoader(false, -1); startLoader(false, PagedView.INVALID_RESTORE_PAGE); } } Loading Loading @@ -1192,7 +1193,8 @@ public class LauncherModel extends BroadcastReceiver { // also, don't downgrade isLaunching if we're already running isLaunching = isLaunching || stopLoaderLocked(); mLoaderTask = new LoaderTask(mApp.getContext(), isLaunching); if (synchronousBindPage > -1 && mAllAppsLoaded && mWorkspaceLoaded) { if (synchronousBindPage != PagedView.INVALID_RESTORE_PAGE && mAllAppsLoaded && mWorkspaceLoaded) { mLoaderTask.runBindSynchronousPage(synchronousBindPage); } else { sWorkerThread.setPriority(Thread.NORM_PRIORITY); Loading Loading @@ -1360,7 +1362,7 @@ public class LauncherModel extends BroadcastReceiver { } void runBindSynchronousPage(int synchronousBindPage) { if (synchronousBindPage < 0) { if (synchronousBindPage == PagedView.INVALID_RESTORE_PAGE) { // Ensure that we have a valid page index to load synchronously throw new RuntimeException("Should not call runBindSynchronousPage() without " + "valid page index"); Loading Loading @@ -2245,16 +2247,17 @@ public class LauncherModel extends BroadcastReceiver { orderedScreenIds.addAll(sBgWorkspaceScreens); } final boolean isLoadingSynchronously = (synchronizeBindPage > -1); final boolean isLoadingSynchronously = synchronizeBindPage != PagedView.INVALID_RESTORE_PAGE; int currScreen = isLoadingSynchronously ? synchronizeBindPage : oldCallbacks.getCurrentWorkspaceScreen(); if (currScreen >= orderedScreenIds.size()) { // There may be no workspace screens (just hotseat items and an empty page). currScreen = -1; currScreen = PagedView.INVALID_RESTORE_PAGE; } final int currentScreen = currScreen; final long currentScreenId = currentScreen < 0 ? -1 : orderedScreenIds.get(currentScreen); final long currentScreenId = currentScreen < 0 ? INVALID_SCREEN_ID : orderedScreenIds.get(currentScreen); // Load all the items that are on the current page first (and in the process, unbind // all the existing workspace items before we call startBinding() below. Loading Loading @@ -2299,7 +2302,7 @@ public class LauncherModel extends BroadcastReceiver { r = new Runnable() { public void run() { Callbacks callbacks = tryGetCallbacks(oldCallbacks); if (callbacks != null && currentScreen >= 0) { if (callbacks != null && currentScreen != PagedView.INVALID_RESTORE_PAGE) { callbacks.onPageBoundSynchronously(currentScreen); } } Loading Loading
src/com/android/launcher3/Launcher.java +2 −2 Original line number Diff line number Diff line Loading @@ -456,7 +456,7 @@ public class Launcher extends Activity if (DISABLE_SYNCHRONOUS_BINDING_CURRENT_PAGE || sPausedFromUserAction) { // If the user leaves launcher, then we should just load items asynchronously when // they return. mModel.startLoader(true, -1); mModel.startLoader(true, PagedView.INVALID_RESTORE_PAGE); } else { // We only load the page synchronously if the user rotates (or triggers a // configuration change) while launcher is in the foreground Loading Loading @@ -914,7 +914,7 @@ public class Launcher extends Activity sPausedFromUserAction = false; if (mRestoring || mOnResumeNeedsLoad) { mWorkspaceLoading = true; mModel.startLoader(true, -1); mModel.startLoader(true, PagedView.INVALID_RESTORE_PAGE); mRestoring = false; mOnResumeNeedsLoad = false; } Loading
src/com/android/launcher3/LauncherModel.java +11 −8 Original line number Diff line number Diff line Loading @@ -75,6 +75,7 @@ public class LauncherModel extends BroadcastReceiver { public static final boolean UPGRADE_USE_MORE_APPS_FOLDER = false; private static final int ITEMS_CHUNK = 6; // batch size for the workspace icons private static final long INVALID_SCREEN_ID = -1L; private final boolean mAppsCanBeOnRemoveableStorage; private final LauncherAppState mApp; Loading Loading @@ -1158,7 +1159,7 @@ public class LauncherModel extends BroadcastReceiver { } } if (runLoader) { startLoader(false, -1); startLoader(false, PagedView.INVALID_RESTORE_PAGE); } } Loading Loading @@ -1192,7 +1193,8 @@ public class LauncherModel extends BroadcastReceiver { // also, don't downgrade isLaunching if we're already running isLaunching = isLaunching || stopLoaderLocked(); mLoaderTask = new LoaderTask(mApp.getContext(), isLaunching); if (synchronousBindPage > -1 && mAllAppsLoaded && mWorkspaceLoaded) { if (synchronousBindPage != PagedView.INVALID_RESTORE_PAGE && mAllAppsLoaded && mWorkspaceLoaded) { mLoaderTask.runBindSynchronousPage(synchronousBindPage); } else { sWorkerThread.setPriority(Thread.NORM_PRIORITY); Loading Loading @@ -1360,7 +1362,7 @@ public class LauncherModel extends BroadcastReceiver { } void runBindSynchronousPage(int synchronousBindPage) { if (synchronousBindPage < 0) { if (synchronousBindPage == PagedView.INVALID_RESTORE_PAGE) { // Ensure that we have a valid page index to load synchronously throw new RuntimeException("Should not call runBindSynchronousPage() without " + "valid page index"); Loading Loading @@ -2245,16 +2247,17 @@ public class LauncherModel extends BroadcastReceiver { orderedScreenIds.addAll(sBgWorkspaceScreens); } final boolean isLoadingSynchronously = (synchronizeBindPage > -1); final boolean isLoadingSynchronously = synchronizeBindPage != PagedView.INVALID_RESTORE_PAGE; int currScreen = isLoadingSynchronously ? synchronizeBindPage : oldCallbacks.getCurrentWorkspaceScreen(); if (currScreen >= orderedScreenIds.size()) { // There may be no workspace screens (just hotseat items and an empty page). currScreen = -1; currScreen = PagedView.INVALID_RESTORE_PAGE; } final int currentScreen = currScreen; final long currentScreenId = currentScreen < 0 ? -1 : orderedScreenIds.get(currentScreen); final long currentScreenId = currentScreen < 0 ? INVALID_SCREEN_ID : orderedScreenIds.get(currentScreen); // Load all the items that are on the current page first (and in the process, unbind // all the existing workspace items before we call startBinding() below. Loading Loading @@ -2299,7 +2302,7 @@ public class LauncherModel extends BroadcastReceiver { r = new Runnable() { public void run() { Callbacks callbacks = tryGetCallbacks(oldCallbacks); if (callbacks != null && currentScreen >= 0) { if (callbacks != null && currentScreen != PagedView.INVALID_RESTORE_PAGE) { callbacks.onPageBoundSynchronously(currentScreen); } } Loading