Merge "Fixing launcher ANR (issue 6238175)"
diff --git a/src/com/android/launcher2/CellLayout.java b/src/com/android/launcher2/CellLayout.java
index 5aa39c4..199c41a 100644
--- a/src/com/android/launcher2/CellLayout.java
+++ b/src/com/android/launcher2/CellLayout.java
@@ -191,6 +191,8 @@
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 @@
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;
}