am 5bb2e9a5: am b24cc640: Fix ArrayIndexOutOfBoundsException.

Merge commit '5bb2e9a55de237e1955ac1fd19eea3771e671afe'

* commit '5bb2e9a55de237e1955ac1fd19eea3771e671afe':
  Fix ArrayIndexOutOfBoundsException.
This commit is contained in:
Ken Wakasa 2010-08-31 17:22:49 -07:00 committed by Android Git Automerger
commit 890c1d5fa3

View file

@ -500,18 +500,20 @@ 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) {
mHandler.cancelKeyTimers();
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) {
Key key = mKeys[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;