diff options
author | Jorim Jaggi <jjaggi@google.com> | 2014-01-13 13:45:07 -0800 |
---|---|---|
committer | Jorim Jaggi <jjaggi@google.com> | 2014-01-14 13:02:43 -0800 |
commit | eedb00a674358bb88dce1e0d3a90bd6cb9e97cfc (patch) | |
tree | b4864dec6df682f89f7471d7a5f518309754b0cd /src | |
parent | 8b5b05b7f3c8c5d705116c425bd5dbff2b75d56a (diff) | |
download | android_packages_apps_Trebuchet-eedb00a674358bb88dce1e0d3a90bd6cb9e97cfc.tar.gz android_packages_apps_Trebuchet-eedb00a674358bb88dce1e0d3a90bd6cb9e97cfc.tar.bz2 android_packages_apps_Trebuchet-eedb00a674358bb88dce1e0d3a90bd6cb9e97cfc.zip |
Fix NPE in Workspace.onDropCompleted
Bug: 11627757
Change-Id: I9dc86856d4bc00253d6350d157be541a8c46888d
Diffstat (limited to 'src')
-rw-r--r-- | src/com/android/launcher3/LauncherAppState.java | 4 | ||||
-rw-r--r-- | src/com/android/launcher3/Workspace.java | 8 |
2 files changed, 11 insertions, 1 deletions
diff --git a/src/com/android/launcher3/LauncherAppState.java b/src/com/android/launcher3/LauncherAppState.java index 5e41fcad0..5cfcf8b9f 100644 --- a/src/com/android/launcher3/LauncherAppState.java +++ b/src/com/android/launcher3/LauncherAppState.java @@ -238,4 +238,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 b6276c0f2..91c29cba9 100644 --- a/src/com/android/launcher3/Workspace.java +++ b/src/com/android/launcher3/Workspace.java @@ -4051,7 +4051,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 || (beingCalledAfterUninstall && !mUninstallSuccessful)) && mDragInfo.cell != null) { |