Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 17dc363a authored by Ken Wakasa's avatar Ken Wakasa
Browse files

Fix an NPE found in KeyboardSwitcher.isAlphabetMode()

Change-Id: I03d3d9b25147632d25c1502f796acad4cdaeb239
parent 979f8690
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -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) {
+1 −1
Original line number Diff line number Diff line
@@ -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);
        }
    }