Merge "Fix NPE in Workspace.onDropCompleted" into jb-ub-now-kermit

This commit is contained in:
Jorim Jaggi authored and Android (Google) Code Review committed 2014-01-14 23:01:48 +00:00
commit 00c3184fa6
2 files changed
+11 -1

No files matched your search

@@ -245,4 +245,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();
}
}
+7 -1
View File
@@ -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) {