aboutsummaryrefslogtreecommitdiffstats
path: root/java/src
diff options
context:
space:
mode:
authorTadashi G. Takaoka <takaoka@google.com>2011-09-08 23:24:20 -0700
committerAndroid (Google) Code Review <android-gerrit@google.com>2011-09-08 23:24:20 -0700
commit530b4176c2a53ef5599eb3a89fcf3ebff90fa84f (patch)
tree70f75542d9167f00c92f7d1aa6a0fd327d1a114a /java/src
parent2cb36637f41418e4037023a47915dd64a30ab869 (diff)
parent8332fd0b81cf8232ca44e698ac3317f358d89ca9 (diff)
downloadlatinime-530b4176c2a53ef5599eb3a89fcf3ebff90fa84f.tar.gz
latinime-530b4176c2a53ef5599eb3a89fcf3ebff90fa84f.tar.xz
latinime-530b4176c2a53ef5599eb3a89fcf3ebff90fa84f.zip
Merge "Fix potential ArrayIndexOutOfBoundsException"
Diffstat (limited to 'java/src')
-rw-r--r--java/src/com/android/inputmethod/latin/MoreSuggestionsView.java5
1 files changed, 4 insertions, 1 deletions
diff --git a/java/src/com/android/inputmethod/latin/MoreSuggestionsView.java b/java/src/com/android/inputmethod/latin/MoreSuggestionsView.java
index f595510a3..a5ff5330e 100644
--- a/java/src/com/android/inputmethod/latin/MoreSuggestionsView.java
+++ b/java/src/com/android/inputmethod/latin/MoreSuggestionsView.java
@@ -67,7 +67,10 @@ public class MoreSuggestionsView extends KeyboardView implements MoreKeysPanel {
@Override
public void onCodeInput(int primaryCode, int[] keyCodes, int x, int y) {
- mListener.onCustomRequest(primaryCode - MoreSuggestions.SUGGESTION_CODE_BASE);
+ final int index = primaryCode - MoreSuggestions.SUGGESTION_CODE_BASE;
+ if (index >= 0 && index < SuggestionsView.MAX_SUGGESTIONS) {
+ mListener.onCustomRequest(index);
+ }
}
@Override