am 5c61d17f: am 8f006edb: Prevent exception in production when icons collide during bind

* commit '5c61d17f0ff67440ce9fb578043a4507b537aa0c':
  Prevent exception in production when icons collide during bind
This commit is contained in:
Adam Cohen
2014-04-04 01:57:48 +00:00
committed by Android Git Automerger
+9 -1
View File
@@ -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);
}
}
}