am c08119e5: [IL36] Inline setAutoCorrection

* commit 'c08119e5c1f302cbc35b2c97d948e691ad8e8a59':
  [IL36] Inline setAutoCorrection
main
Jean Chalard 2013-12-25 21:19:33 -08:00 committed by Android Git Automerger
commit e86dc236f5
1 changed files with 9 additions and 14 deletions

View File

@ -1611,8 +1611,14 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
false /* isPrediction */);
}
private void setAutoCorrection(final SuggestedWords suggestedWords, final String typedWord) {
if (suggestedWords.isEmpty()) return;
private void showSuggestionStripWithTypedWord(final SuggestedWords suggestedWords,
final String typedWord) {
if (suggestedWords.isEmpty()) {
// No auto-correction is available, clear the cached values.
AccessibilityUtils.getInstance().setAutoCorrection(null, null);
clearSuggestionStrip();
return;
}
final String autoCorrection;
if (suggestedWords.mWillAutoCorrect) {
autoCorrection = suggestedWords.getWord(SuggestedWords.INDEX_OF_AUTO_CORRECTION);
@ -1622,17 +1628,6 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
autoCorrection = typedWord;
}
mInputLogic.mWordComposer.setAutoCorrection(autoCorrection);
}
private void showSuggestionStripWithTypedWord(final SuggestedWords suggestedWords,
final String typedWord) {
if (suggestedWords.isEmpty()) {
// No auto-correction is available, clear the cached values.
AccessibilityUtils.getInstance().setAutoCorrection(null, null);
clearSuggestionStrip();
return;
}
setAutoCorrection(suggestedWords, typedWord);
final boolean isAutoCorrection = suggestedWords.willAutoCorrect();
setSuggestedWords(suggestedWords, isAutoCorrection);
setAutoCorrectionIndicator(isAutoCorrection);