summaryrefslogtreecommitdiffstats
path: root/src/com
diff options
context:
space:
mode:
Diffstat (limited to 'src/com')
-rw-r--r--src/com/android/launcher2/Launcher.java6
-rw-r--r--src/com/android/launcher2/LauncherModel.java12
2 files changed, 11 insertions, 7 deletions
diff --git a/src/com/android/launcher2/Launcher.java b/src/com/android/launcher2/Launcher.java
index 13a39a3a3..6bd915aa0 100644
--- a/src/com/android/launcher2/Launcher.java
+++ b/src/com/android/launcher2/Launcher.java
@@ -2093,7 +2093,11 @@ public final class Launcher extends Activity
* Implementation of the method from LauncherModel.Callbacks.
*/
public int getCurrentWorkspaceScreen() {
- return mWorkspace.getCurrentScreen();
+ if (mWorkspace != null) {
+ return mWorkspace.getCurrentScreen();
+ } else {
+ return SCREEN_COUNT / 2;
+ }
}
/**
diff --git a/src/com/android/launcher2/LauncherModel.java b/src/com/android/launcher2/LauncherModel.java
index 17cd15101..17f75732a 100644
--- a/src/com/android/launcher2/LauncherModel.java
+++ b/src/com/android/launcher2/LauncherModel.java
@@ -304,13 +304,13 @@ public class LauncherModel extends BroadcastReceiver {
ArrayList<ApplicationInfo> removed = null;
ArrayList<ApplicationInfo> modified = null;
- synchronized (mAllAppsListLock) {
- if (mBeforeFirstLoad) {
- // If we haven't even loaded yet, don't bother, since we'll just pick
- // up the changes.
- return;
- }
+ if (mBeforeFirstLoad) {
+ // If we haven't even loaded yet, don't bother, since we'll just pick
+ // up the changes.
+ return;
+ }
+ synchronized (mAllAppsListLock) {
final String action = intent.getAction();
if (Intent.ACTION_PACKAGE_CHANGED.equals(action)