Fixing launcher ANR (issue 6238175)

Change-Id: I6518ea9e6ce8b50a5f2a3b24e909e18c5b1bde51
This commit is contained in:
Adam Cohen
2012-03-29 14:30:35 -07:00
committed by The Android Automerger
parent 75ddf9f09c
commit 8e6c43da73
+4 -1
View File
@@ -191,6 +191,8 @@ public class CellLayout extends ViewGroup {
mCountY = LauncherModel.getCellCountY();
mOccupied = new boolean[mCountX][mCountY];
mTmpOccupied = new boolean[mCountX][mCountY];
mPreviousReorderDirection[0] = INVALID_DIRECTION;
mPreviousReorderDirection[1] = INVALID_DIRECTION;
a.recycle();
@@ -1566,7 +1568,8 @@ public class CellLayout extends ViewGroup {
float bestDistance = Float.MAX_VALUE;
// We use this to march in a single direction
if (direction[0] != 0 && direction[1] != 0) {
if ((direction[0] != 0 && direction[1] != 0) ||
(direction[0] == 0 && direction[1] == 0)) {
return bestXY;
}