From eef539c3f2b60af74a3ce05ac68288e7f86709ae Mon Sep 17 00:00:00 2001 From: Amith Yamasani Date: Fri, 9 Oct 2009 07:03:11 -0700 Subject: [PATCH] Fix a potential IllegalArgumentException caught by monkeys. #2176776 For some reason the key code is outside the code point range. Adding a safeguard to deal with possible out of range key codes. --- src/com/android/inputmethod/latin/LatinIME.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/com/android/inputmethod/latin/LatinIME.java b/src/com/android/inputmethod/latin/LatinIME.java index 8c9102d8c..ae296aff6 100644 --- a/src/com/android/inputmethod/latin/LatinIME.java +++ b/src/com/android/inputmethod/latin/LatinIME.java @@ -693,6 +693,10 @@ public class LatinIME extends InputMethodService } if (mInputView.isShifted()) { // TODO: This doesn't work with ß, need to fix it in the next release. + if (keyCodes == null || keyCodes[0] < Character.MIN_CODE_POINT + || keyCodes[0] > Character.MAX_CODE_POINT) { + return; + } primaryCode = new String(keyCodes, 0, 1).toUpperCase().charAt(0); } if (mPredicting) {