Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 8f006edb authored by Adam Cohen's avatar Adam Cohen
Browse files

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
parent cc95d18d
Loading
Loading
Loading
Loading
+9 −1
Original line number Diff line number Diff line
@@ -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);
                            }
                        }
                    }