am 3ecb4813: am 17dc363a: Fix an NPE found in KeyboardSwitcher.isAlphabetMode()

Merge commit '3ecb4813f1f77ce9330b08a1a2ab83d26df05e51'

* commit '3ecb4813f1f77ce9330b08a1a2ab83d26df05e51':
  Fix an NPE found in KeyboardSwitcher.isAlphabetMode()
main
Ken Wakasa 2010-08-23 12:02:52 -07:00 committed by Android Git Automerger
commit 159bc3cf43
2 changed files with 4 additions and 1 deletions

View File

@ -335,6 +335,9 @@ public class KeyboardSwitcher implements SharedPreferences.OnSharedPreferenceCha
}
boolean isAlphabetMode() {
if (mCurrentId == null) {
return false;
}
int currentMode = mCurrentId.mKeyboardMode;
for (Integer mode : ALPHABET_MODES) {
if (currentMode == mode) {

View File

@ -968,7 +968,7 @@ public class LatinIME extends InputMethodService
public void updateShiftKeyState(EditorInfo attr) {
InputConnection ic = getCurrentInputConnection();
if (attr != null && mKeyboardSwitcher.isAlphabetMode() && ic != null) {
if (ic != null && attr != null && mKeyboardSwitcher.isAlphabetMode()) {
mKeyboardSwitcher.setShifted(mCapsLock || getCursorCapsMode(ic, attr) != 0);
}
}