summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJorim Jaggi <jjaggi@google.com>2014-01-13 13:45:07 -0800
committerDanesh M <daneshm90@gmail.com>2014-06-06 22:54:25 -0700
commit1d5ede1a757f9d4ea8c0a7882e8c6ecd6fb22d37 (patch)
treeebe1719eedca3b8ad4de29006c601bc34fbf5ac3
parent2762189999d34dd98fb853e1436c762ee4b3b1d8 (diff)
downloadandroid_packages_apps_Trebuchet-1d5ede1a757f9d4ea8c0a7882e8c6ecd6fb22d37.tar.gz
android_packages_apps_Trebuchet-1d5ede1a757f9d4ea8c0a7882e8c6ecd6fb22d37.tar.bz2
android_packages_apps_Trebuchet-1d5ede1a757f9d4ea8c0a7882e8c6ecd6fb22d37.zip
Fix NPE in Workspace.onDropCompleted
Bug: 11627757 Change-Id: I9dc86856d4bc00253d6350d157be541a8c46888d
-rw-r--r--src/com/android/launcher3/LauncherAppState.java4
-rw-r--r--src/com/android/launcher3/Workspace.java8
2 files changed, 11 insertions, 1 deletions
diff --git a/src/com/android/launcher3/LauncherAppState.java b/src/com/android/launcher3/LauncherAppState.java
index c0da25e89..af1cdf588 100644
--- a/src/com/android/launcher3/LauncherAppState.java
+++ b/src/com/android/launcher3/LauncherAppState.java
@@ -259,4 +259,8 @@ public class LauncherAppState implements DeviceProfile.DeviceProfileCallbacks {
return getInstance().mBuildInfo.isDogfoodBuild() &&
Launcher.isPropertyEnabled(Launcher.DISABLE_ALL_APPS_PROPERTY);
}
+
+ public static boolean isDogfoodBuild() {
+ return getInstance().mBuildInfo.isDogfoodBuild();
+ }
}
diff --git a/src/com/android/launcher3/Workspace.java b/src/com/android/launcher3/Workspace.java
index 690cd1e08..0d0e5af0e 100644
--- a/src/com/android/launcher3/Workspace.java
+++ b/src/com/android/launcher3/Workspace.java
@@ -4210,7 +4210,13 @@ public class Workspace extends SmoothPagedView
} else {
cellLayout = getScreenWithId(mDragInfo.screenId);
}
- cellLayout.onDropChild(mDragInfo.cell);
+ if (cellLayout == null && LauncherAppState.isDogfoodBuild()) {
+ throw new RuntimeException("Invalid state: cellLayout == null in "
+ + "Workspace#onDropCompleted. Please file a bug. ");
+ }
+ if (cellLayout != null) {
+ cellLayout.onDropChild(mDragInfo.cell);
+ }
}
if ((d.cancelled || target instanceof InfoDropTarget || (beingCalledAfterUninstall && !mUninstallSuccessful))
&& mDragInfo.cell != null) {