diff options
author | 2010-09-01 09:11:38 +0900 | |
---|---|---|
committer | 2010-09-01 09:11:38 +0900 | |
commit | b24cc640c1485590b1e9912397ea9acd68b43d99 (patch) | |
tree | 09e2b6a2d2b94222e11cad2fac5c08281675e9e2 /java/src/com/android/inputmethod/latin/LatinKeyboardBaseView.java | |
parent | ca4e42785f598af9f24a9e3e2ae644ffa83c77ed (diff) | |
download | latinime-b24cc640c1485590b1e9912397ea9acd68b43d99.tar.gz latinime-b24cc640c1485590b1e9912397ea9acd68b43d99.tar.xz latinime-b24cc640c1485590b1e9912397ea9acd68b43d99.zip |
Fix ArrayIndexOutOfBoundsException.
bug: 2964045
Change-Id: I97d95181e1a6838ace9c135aa92e7f20034e821f
Diffstat (limited to 'java/src/com/android/inputmethod/latin/LatinKeyboardBaseView.java')
-rw-r--r-- | java/src/com/android/inputmethod/latin/LatinKeyboardBaseView.java | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/java/src/com/android/inputmethod/latin/LatinKeyboardBaseView.java b/java/src/com/android/inputmethod/latin/LatinKeyboardBaseView.java index efce0d193..280801a55 100644 --- a/java/src/com/android/inputmethod/latin/LatinKeyboardBaseView.java +++ b/java/src/com/android/inputmethod/latin/LatinKeyboardBaseView.java @@ -500,8 +500,9 @@ public class LatinKeyboardBaseView extends View implements View.OnClickListener if (!wasInKeyRepeat && !mProxy.isMiniKeyboardOnScreen()) { detectAndSendKey(mCurrentKey, touchX, touchY, eventTime); } - if (keyIndex != NOT_A_KEY) + if (keyIndex != NOT_A_KEY && keyIndex < mKeys.length) { mProxy.invalidateKey(mKeys[keyIndex]); + } } public void onCancelEvent(int touchX, int touchY, long eventTime) { @@ -509,8 +510,9 @@ public class LatinKeyboardBaseView extends View implements View.OnClickListener mHandler.cancelPopupPreview(); mProxy.dismissPopupKeyboard(); showKeyPreviewAndUpdateKey(NOT_A_KEY); - if (mCurrentKey != NOT_A_KEY) + if (mCurrentKey != NOT_A_KEY && mCurrentKey < mKeys.length) { mProxy.invalidateKey(mKeys[mCurrentKey]); + } } public void repeatKey(int keyIndex) { @@ -670,7 +672,7 @@ public class LatinKeyboardBaseView extends View implements View.OnClickListener } private void checkMultiTap(long eventTime, int keyIndex) { - if (keyIndex == NOT_A_KEY) return; + if (keyIndex == NOT_A_KEY || keyIndex >= mKeys.length) return; Key key = mKeys[keyIndex]; if (key.codes.length > 1) { mInMultiTap = true; |