[IL91] Call reorder
Bug: 8636060 Change-Id: I3d0ce6dcb3b51cabc424d00a397d243c32360e92main
parent
01893b25dd
commit
c6367ee64d
|
@ -1429,13 +1429,6 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
|
||||||
// TODO: refactor this
|
// TODO: refactor this
|
||||||
final SuggestedWords suggestedWords =
|
final SuggestedWords suggestedWords =
|
||||||
sourceSuggestedWords.isEmpty() ? SuggestedWords.EMPTY : sourceSuggestedWords;
|
sourceSuggestedWords.isEmpty() ? SuggestedWords.EMPTY : sourceSuggestedWords;
|
||||||
if (suggestedWords.isEmpty()) {
|
|
||||||
// No auto-correction is available, clear the cached values.
|
|
||||||
AccessibilityUtils.getInstance().setAutoCorrection(suggestedWords, typedWord);
|
|
||||||
setSuggestedWords(suggestedWords);
|
|
||||||
setAutoCorrectionIndicator(false);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
final String autoCorrection;
|
final String autoCorrection;
|
||||||
if (suggestedWords.mWillAutoCorrect) {
|
if (suggestedWords.mWillAutoCorrect) {
|
||||||
autoCorrection = suggestedWords.getWord(SuggestedWords.INDEX_OF_AUTO_CORRECTION);
|
autoCorrection = suggestedWords.getWord(SuggestedWords.INDEX_OF_AUTO_CORRECTION);
|
||||||
|
@ -1444,12 +1437,18 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
|
||||||
// because it may differ from mWordComposer.mTypedWord.
|
// because it may differ from mWordComposer.mTypedWord.
|
||||||
autoCorrection = typedWord;
|
autoCorrection = typedWord;
|
||||||
}
|
}
|
||||||
|
if (suggestedWords.isEmpty()) {
|
||||||
|
AccessibilityUtils.getInstance().setAutoCorrection(suggestedWords, typedWord);
|
||||||
|
setSuggestedWords(suggestedWords);
|
||||||
|
setAutoCorrectionIndicator(false);
|
||||||
|
return;
|
||||||
|
}
|
||||||
mInputLogic.mWordComposer.setAutoCorrection(autoCorrection);
|
mInputLogic.mWordComposer.setAutoCorrection(autoCorrection);
|
||||||
setSuggestedWords(suggestedWords);
|
setSuggestedWords(suggestedWords);
|
||||||
setAutoCorrectionIndicator(suggestedWords.mWillAutoCorrect);
|
setAutoCorrectionIndicator(suggestedWords.mWillAutoCorrect);
|
||||||
setSuggestionStripShown(isSuggestionsStripVisible());
|
setSuggestionStripShown(isSuggestionsStripVisible());
|
||||||
// An auto-correction is available, cache it in accessibility code so
|
// Cache the auto-correction in accessibility code so we can speak it if the user
|
||||||
// we can be speak it if the user touches a key that will insert it.
|
// touches a key that will insert it.
|
||||||
AccessibilityUtils.getInstance().setAutoCorrection(suggestedWords, typedWord);
|
AccessibilityUtils.getInstance().setAutoCorrection(suggestedWords, typedWord);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue