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:57:00 -0800
committerAndroid (Google) Code Review <android-gerrit@google.com>2012-03-05 02:57:00 -0800
commitd5b6360549c1e97958a2ec25e5c20ab4d8b455b1 (patch)
tree1a05455c82ed9a8f6bf892540d48ad1c03dfe8af /java/src/com/android/inputmethod/latin/LatinIME.java
parent6a830277dfca9bfa4ec783048cfd2de7504d6fc3 (diff)
parentd62fa834c6f42b23f010e67086bef909bc57d958 (diff)
downloadlatinime-d5b6360549c1e97958a2ec25e5c20ab4d8b455b1.tar.gz
latinime-d5b6360549c1e97958a2ec25e5c20ab4d8b455b1.tar.xz
latinime-d5b6360549c1e97958a2ec25e5c20ab4d8b455b1.zip
Merge "Revert "Make SuggestedWords immutable""
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 66f0ec03f..edc4efd1a 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 {
@@ -1909,7 +1910,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 },
@@ -1920,7 +1922,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);