summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAdam Cohen <adamcohen@google.com>2014-04-03 18:12:34 -0700
committerAdam Cohen <adamcohen@google.com>2014-04-03 18:14:30 -0700
commit8f006edba228622422088a358aafee069e1d9cfb (patch)
tree2300610a482a13dab60f47797f6e279fda5e53e3
parentcc95d18d6ddeaf247b1f43659153edb1b3f315d7 (diff)
downloadandroid_packages_apps_Trebuchet-8f006edba228622422088a358aafee069e1d9cfb.tar.gz
android_packages_apps_Trebuchet-8f006edba228622422088a358aafee069e1d9cfb.tar.bz2
android_packages_apps_Trebuchet-8f006edba228622422088a358aafee069e1d9cfb.zip
Prevent exception in production when icons collide during bind
-> We only need to throw an exception for dogfooders so we can track the issue -> Worst case, an icon is ignored, does not warrant a crash. issue 12106766 Change-Id: I054a849eb3d65762dc5e1bf699c76655f687c3e8
-rw-r--r--src/com/android/launcher3/Launcher.java10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/com/android/launcher3/Launcher.java b/src/com/android/launcher3/Launcher.java
index 5bdd7eb33..6474d26b8 100644
--- a/src/com/android/launcher3/Launcher.java
+++ b/src/com/android/launcher3/Launcher.java
@@ -3982,7 +3982,15 @@ public class Launcher extends Activity
if (item.container == LauncherSettings.Favorites.CONTAINER_DESKTOP) {
CellLayout cl = mWorkspace.getScreenWithId(item.screenId);
if (cl != null && cl.isOccupied(item.cellX, item.cellY)) {
- throw new RuntimeException("OCCUPIED");
+ View v = cl.getChildAt(item.cellX, item.cellY);
+ Object tag = v.getTag();
+ String desc = "Collision while binding workspace item: " + item
+ + ". Collides with " + tag;
+ if (LauncherAppState.isDogfoodBuild()) {
+ throw (new RuntimeException(desc));
+ } else {
+ Log.d(TAG, desc);
+ }
}
}