Merge "Fix NPE"
commit
76427c8e56
|
@ -782,11 +782,15 @@ public class KeyboardSwitcher implements SharedPreferences.OnSharedPreferenceCha
|
||||||
}
|
}
|
||||||
|
|
||||||
public void onAutoCorrectionStateChanged(boolean isAutoCorrection) {
|
public void onAutoCorrectionStateChanged(boolean isAutoCorrection) {
|
||||||
if (isAutoCorrection != mIsAutoCorrectionActive) {
|
if (mIsAutoCorrectionActive != isAutoCorrection) {
|
||||||
LatinKeyboardView keyboardView = getKeyboardView();
|
|
||||||
mIsAutoCorrectionActive = isAutoCorrection;
|
mIsAutoCorrectionActive = isAutoCorrection;
|
||||||
keyboardView.invalidateKey(((LatinKeyboard) keyboardView.getKeyboard())
|
final LatinKeyboard keyboard = getLatinKeyboard();
|
||||||
.onAutoCorrectionStateChanged(isAutoCorrection));
|
if (keyboard != null && keyboard.needsAutoCorrectionSpacebarLed()) {
|
||||||
|
final Key invalidatedKey = keyboard.onAutoCorrectionStateChanged(isAutoCorrection);
|
||||||
|
final LatinKeyboardView keyboardView = getKeyboardView();
|
||||||
|
if (keyboardView != null)
|
||||||
|
keyboardView.invalidateKey(invalidatedKey);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1459,18 +1459,12 @@ public class LatinIME extends InputMethodServiceCompatWrapper implements Keyboar
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setSuggestions(SuggestedWords words) {
|
public void setSuggestions(SuggestedWords words) {
|
||||||
// if (mVoiceProxy.getAndResetIsShowingHint()) {
|
|
||||||
// setCandidatesView(mCandidateViewContainer);
|
|
||||||
// }
|
|
||||||
|
|
||||||
if (mCandidateView != null) {
|
if (mCandidateView != null) {
|
||||||
mCandidateView.setSuggestions(words);
|
mCandidateView.setSuggestions(words);
|
||||||
if (mKeyboardSwitcher.getLatinKeyboard().needsAutoCorrectionSpacebarLed()) {
|
|
||||||
mKeyboardSwitcher.onAutoCorrectionStateChanged(
|
mKeyboardSwitcher.onAutoCorrectionStateChanged(
|
||||||
words.hasWordAboveAutoCorrectionScoreThreshold());
|
words.hasWordAboveAutoCorrectionScoreThreshold());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
public void updateSuggestions() {
|
public void updateSuggestions() {
|
||||||
// Check if we have a suggestion engine attached.
|
// Check if we have a suggestion engine attached.
|
||||||
|
|
Loading…
Reference in New Issue