aboutsummaryrefslogtreecommitdiffstats
path: root/java/src
diff options
context:
space:
mode:
authorJean Chalard <jchalard@google.com>2014-01-24 20:57:48 +0900
committerJean Chalard <jchalard@google.com>2014-01-27 20:38:43 +0900
commitc6367ee64d9e301d8c2e920ada57a5550aafa596 (patch)
tree2d2ec020d59ff4fa28b70e8e1de61b9d4846e9f7 /java/src
parent01893b25dd25266d14c38d892176fbda052e1812 (diff)
downloadlatinime-c6367ee64d9e301d8c2e920ada57a5550aafa596.tar.gz
latinime-c6367ee64d9e301d8c2e920ada57a5550aafa596.tar.xz
latinime-c6367ee64d9e301d8c2e920ada57a5550aafa596.zip
[IL91] Call reorder
Bug: 8636060 Change-Id: I3d0ce6dcb3b51cabc424d00a397d243c32360e92
Diffstat (limited to 'java/src')
-rw-r--r--java/src/com/android/inputmethod/latin/LatinIME.java17
1 files changed, 8 insertions, 9 deletions
diff --git a/java/src/com/android/inputmethod/latin/LatinIME.java b/java/src/com/android/inputmethod/latin/LatinIME.java
index ba7503dae..da16d2fe3 100644
--- a/java/src/com/android/inputmethod/latin/LatinIME.java
+++ b/java/src/com/android/inputmethod/latin/LatinIME.java
@@ -1429,13 +1429,6 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
// TODO: refactor this
final SuggestedWords suggestedWords =
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;
if (suggestedWords.mWillAutoCorrect) {
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.
autoCorrection = typedWord;
}
+ if (suggestedWords.isEmpty()) {
+ AccessibilityUtils.getInstance().setAutoCorrection(suggestedWords, typedWord);
+ setSuggestedWords(suggestedWords);
+ setAutoCorrectionIndicator(false);
+ return;
+ }
mInputLogic.mWordComposer.setAutoCorrection(autoCorrection);
setSuggestedWords(suggestedWords);
setAutoCorrectionIndicator(suggestedWords.mWillAutoCorrect);
setSuggestionStripShown(isSuggestionsStripVisible());
- // An auto-correction is available, cache it in accessibility code so
- // we can be speak it if the user touches a key that will insert it.
+ // Cache the auto-correction in accessibility code so we can speak it if the user
+ // touches a key that will insert it.
AccessibilityUtils.getInstance().setAutoCorrection(suggestedWords, typedWord);
}