From d7e9e37cb7b253b4b68b8229e5baa7031b65d2e2 Mon Sep 17 00:00:00 2001 From: Winson Chung Date: Tue, 24 Apr 2012 14:49:03 -0700 Subject: Fixing issue where ItemInfo had errant cell coordinates leading to an array-out-of-bounds exception. (Bug 6333784) Change-Id: I03c3fe32bd1d027143aeb8abf9275ecaa688070f --- src/com/android/launcher2/InstallShortcutReceiver.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/com/android/launcher2/InstallShortcutReceiver.java b/src/com/android/launcher2/InstallShortcutReceiver.java index 19b1c69d2..f493701b2 100644 --- a/src/com/android/launcher2/InstallShortcutReceiver.java +++ b/src/com/android/launcher2/InstallShortcutReceiver.java @@ -174,8 +174,8 @@ public class InstallShortcutReceiver extends BroadcastReceiver { cellY = item.cellY; spanX = item.spanX; spanY = item.spanY; - for (int x = cellX; x < cellX + spanX && x < xCount; x++) { - for (int y = cellY; y < cellY + spanY && y < yCount; y++) { + for (int x = cellX; 0 <= x && x < cellX + spanX && x < xCount; x++) { + for (int y = cellY; 0 <= y && y < cellY + spanY && y < yCount; y++) { occupied[x][y] = true; } } -- cgit v1.2.3