aboutsummaryrefslogtreecommitdiffstats
path: root/java/src/com/android/inputmethod
diff options
context:
space:
mode:
authorKen Wakasa <kwakasa@google.com>2013-08-29 01:34:23 -0700
committerAndroid Git Automerger <android-git-automerger@android.com>2013-08-29 01:34:23 -0700
commitf0229f223b51981fe2da05a29d744cc83cf92d80 (patch)
tree0c1c1494739a10243934fbe14df8ffd744d2159d /java/src/com/android/inputmethod
parentb619acfdc6cd943b0b631cc587a0753660094a23 (diff)
parent2cbc7c682d003c97431235fedbfd21e8473e180c (diff)
downloadlatinime-f0229f223b51981fe2da05a29d744cc83cf92d80.tar.gz
latinime-f0229f223b51981fe2da05a29d744cc83cf92d80.tar.xz
latinime-f0229f223b51981fe2da05a29d744cc83cf92d80.zip
am 2cbc7c68: Merge "Workaround for AIOOB exception in ProximityInfo"
* commit '2cbc7c682d003c97431235fedbfd21e8473e180c': Workaround for AIOOB exception in ProximityInfo
Diffstat (limited to 'java/src/com/android/inputmethod')
-rw-r--r--java/src/com/android/inputmethod/keyboard/ProximityInfo.java4
1 files changed, 3 insertions, 1 deletions
diff --git a/java/src/com/android/inputmethod/keyboard/ProximityInfo.java b/java/src/com/android/inputmethod/keyboard/ProximityInfo.java
index c0c02f10a..cd127c760 100644
--- a/java/src/com/android/inputmethod/keyboard/ProximityInfo.java
+++ b/java/src/com/android/inputmethod/keyboard/ProximityInfo.java
@@ -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];
}