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

Commit f0229f22 authored by Ken Wakasa's avatar Ken Wakasa Committed by Android Git Automerger
Browse files

am 2cbc7c68: Merge "Workaround for AIOOB exception in ProximityInfo"

* commit '2cbc7c68':
  Workaround for AIOOB exception in ProximityInfo
parents b619acfd 2cbc7c68
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -342,7 +342,9 @@ y |---+---+---+---+-v-+-|-+---+---+---+---+---| | thresholdBase and get
            for (int centerY = yStart; centerY <= yEnd; centerY += mCellHeight) {
                int index = baseIndexOfCurrentRow;
                for (int centerX = xStart; centerX <= xEnd; centerX += mCellWidth) {
                    if (key.squaredDistanceToEdge(centerX, centerY) < thresholdSquared) {
                    // TODO: Remove "index < neighborCountPerCell.length" below.
                    if (index < neighborCountPerCell.length
                            && key.squaredDistanceToEdge(centerX, centerY) < thresholdSquared) {
                        neighborsFlatBuffer[index * keyCount + neighborCountPerCell[index]] = key;
                        ++neighborCountPerCell[index];
                    }