aboutsummaryrefslogtreecommitdiffstats
path: root/java/src/com/android/inputmethod/latin/LatinIME.java
diff options
context:
space:
mode:
authorTadashi Takaoka <takaoka@google.com>2012-03-05 02:54:21 -0800
committerAndroid (Google) Code Review <android-gerrit@google.com>2012-03-05 02:54:21 -0800
commitd62fa834c6f42b23f010e67086bef909bc57d958 (patch)
tree7c8a8b28f64788dfd6ffcde8ec8fb32f5cb971ee /java/src/com/android/inputmethod/latin/LatinIME.java
parentc208f4dfb7abe1b7a83c725d515edb3615d5d927 (diff)
downloadlatinime-d62fa834c6f42b23f010e67086bef909bc57d958.tar.gz
latinime-d62fa834c6f42b23f010e67086bef909bc57d958.tar.xz
latinime-d62fa834c6f42b23f010e67086bef909bc57d958.zip
Revert "Make SuggestedWords immutable"
This reverts commit c208f4dfb7abe1b7a83c725d515edb3615d5d927
Diffstat (limited to 'java/src/com/android/inputmethod/latin/LatinIME.java')
-rw-r--r--java/src/com/android/inputmethod/latin/LatinIME.java12
1 files changed, 7 insertions, 5 deletions
diff --git a/java/src/com/android/inputmethod/latin/LatinIME.java b/java/src/com/android/inputmethod/latin/LatinIME.java
index 6c9a827d6..59fa66ded 100644
--- a/java/src/com/android/inputmethod/latin/LatinIME.java
+++ b/java/src/com/android/inputmethod/latin/LatinIME.java
@@ -1827,8 +1827,9 @@ public class LatinIME extends InputMethodServiceCompatWrapper implements Keyboar
builder.addTypedWordAndPreviousSuggestions(typedWord, previousSuggestions);
}
}
- if (Utils.shouldBlockAutoCorrectionBySafetyNet(builder, mSuggest)) {
- builder.setShouldBlockAutoCorrectionBySafetyNet();
+ final SuggestedWords suggestedWords = builder.build();
+ if (Utils.shouldBlockAutoCorrectionBySafetyNet(suggestedWords, mSuggest)) {
+ suggestedWords.setShouldBlockAutoCorrectionBySatefyNet();
}
showSuggestions(builder.build(), typedWord);
}
@@ -1836,7 +1837,7 @@ public class LatinIME extends InputMethodServiceCompatWrapper implements Keyboar
public void showSuggestions(final SuggestedWords suggestedWords, final CharSequence typedWord) {
final CharSequence autoCorrection;
if (suggestedWords.size() > 0) {
- if (!suggestedWords.mShouldBlockAutoCorrectionBySafetyNet
+ if (!suggestedWords.shouldBlockAutoCorrectionBySafetyNet()
&& suggestedWords.hasAutoCorrectionWord()) {
autoCorrection = suggestedWords.getWord(1);
} else {
@@ -1910,7 +1911,8 @@ public class LatinIME extends InputMethodServiceCompatWrapper implements Keyboar
if (suggestion.length() == 1 && isShowingPunctuationList()) {
// Word separators are suggested before the user inputs something.
// So, LatinImeLogger logs "" as a user's input.
- LatinImeLogger.logOnManualSuggestion("", suggestion.toString(), index, suggestions);
+ LatinImeLogger.logOnManualSuggestion(
+ "", suggestion.toString(), index, suggestions.mWords);
// Rely on onCodeInput to do the complicated swapping/stripping logic consistently.
final int primaryCode = suggestion.charAt(0);
onCodeInput(primaryCode, new int[] { primaryCode },
@@ -1921,7 +1923,7 @@ public class LatinIME extends InputMethodServiceCompatWrapper implements Keyboar
// We need to log before we commit, because the word composer will store away the user
// typed word.
LatinImeLogger.logOnManualSuggestion(mWordComposer.getTypedWord().toString(),
- suggestion.toString(), index, suggestions);
+ suggestion.toString(), index, suggestions.mWords);
mExpectingUpdateSelection = true;
commitChosenWord(suggestion, LastComposedWord.COMMIT_TYPE_MANUAL_PICK,
LastComposedWord.NOT_A_SEPARATOR);