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

Commit 76427c8e authored by Tadashi G. Takaoka's avatar Tadashi G. Takaoka Committed by Android (Google) Code Review
Browse files

Merge "Fix NPE"

parents ada37cb4 5e4e05af
Loading
Loading
Loading
Loading
+8 −4
Original line number Diff line number Diff line
@@ -782,11 +782,15 @@ public class KeyboardSwitcher implements SharedPreferences.OnSharedPreferenceCha
    }

    public void onAutoCorrectionStateChanged(boolean isAutoCorrection) {
        if (isAutoCorrection != mIsAutoCorrectionActive) {
            LatinKeyboardView keyboardView = getKeyboardView();
        if (mIsAutoCorrectionActive != isAutoCorrection) {
            mIsAutoCorrectionActive = isAutoCorrection;
            keyboardView.invalidateKey(((LatinKeyboard) keyboardView.getKeyboard())
                    .onAutoCorrectionStateChanged(isAutoCorrection));
            final LatinKeyboard keyboard = getLatinKeyboard();
            if (keyboard != null && keyboard.needsAutoCorrectionSpacebarLed()) {
                final Key invalidatedKey = keyboard.onAutoCorrectionStateChanged(isAutoCorrection);
                final LatinKeyboardView keyboardView = getKeyboardView();
                if (keyboardView != null)
                    keyboardView.invalidateKey(invalidatedKey);
            }
        }
    }

+2 −8
Original line number Diff line number Diff line
@@ -1459,18 +1459,12 @@ public class LatinIME extends InputMethodServiceCompatWrapper implements Keyboar
    }

    public void setSuggestions(SuggestedWords words) {
//        if (mVoiceProxy.getAndResetIsShowingHint()) {
//             setCandidatesView(mCandidateViewContainer);
//        }

        if (mCandidateView != null) {
            mCandidateView.setSuggestions(words);
            if (mKeyboardSwitcher.getLatinKeyboard().needsAutoCorrectionSpacebarLed()) {
            mKeyboardSwitcher.onAutoCorrectionStateChanged(
                    words.hasWordAboveAutoCorrectionScoreThreshold());
        }
    }
    }

    public void updateSuggestions() {
        // Check if we have a suggestion engine attached.