aboutsummaryrefslogtreecommitdiffstats
path: root/java/src/com/android/inputmethod
diff options
context:
space:
mode:
authorJean Chalard <jchalard@google.com>2011-12-15 10:08:28 -0800
committerAndroid Git Automerger <android-git-automerger@android.com>2011-12-15 10:08:28 -0800
commite3297a79ffc2728bdc527669c6ba817c4202482e (patch)
treede88c04a4578eeb80df7d027d171152ab6b98bc9 /java/src/com/android/inputmethod
parent7bc67e14a1b6ce738a06cc3c179084a36982125b (diff)
parent9750165c9a134a8981747f1ca1d279f0086829e5 (diff)
downloadlatinime-e3297a79ffc2728bdc527669c6ba817c4202482e.tar.gz
latinime-e3297a79ffc2728bdc527669c6ba817c4202482e.tar.xz
latinime-e3297a79ffc2728bdc527669c6ba817c4202482e.zip
am 9750165c: Merge "Cleanup"
* commit '9750165c9a134a8981747f1ca1d279f0086829e5': Cleanup
Diffstat (limited to 'java/src/com/android/inputmethod')
-rw-r--r--java/src/com/android/inputmethod/latin/LatinIME.java11
1 files changed, 5 insertions, 6 deletions
diff --git a/java/src/com/android/inputmethod/latin/LatinIME.java b/java/src/com/android/inputmethod/latin/LatinIME.java
index fdbc9d8e2..98fea1b5b 100644
--- a/java/src/com/android/inputmethod/latin/LatinIME.java
+++ b/java/src/com/android/inputmethod/latin/LatinIME.java
@@ -1602,7 +1602,7 @@ public class LatinIME extends InputMethodServiceCompatWrapper implements Keyboar
final boolean shouldAutoCorrect = mSettingsValues.mAutoCorrectEnabled
&& !mInputTypeNoAutoCorrect;
if (shouldAutoCorrect && primaryCode != Keyboard.CODE_SINGLE_QUOTE) {
- final boolean didAutoCorrect = commitCurrentAutoCorrection(primaryCode, ic);
+ commitCurrentAutoCorrection(primaryCode, ic);
} else {
commitTyped(ic);
}
@@ -1859,7 +1859,8 @@ public class LatinIME extends InputMethodServiceCompatWrapper implements Keyboar
setSuggestionStripShown(isSuggestionsStripVisible());
}
- private boolean commitCurrentAutoCorrection(final int separatorCode, final InputConnection ic) {
+ private void commitCurrentAutoCorrection(final int separatorCodePoint,
+ final InputConnection ic) {
// Complete any pending suggestions query first
if (mHandler.hasPendingUpdateSuggestions()) {
mHandler.cancelUpdateSuggestions();
@@ -1872,7 +1873,7 @@ public class LatinIME extends InputMethodServiceCompatWrapper implements Keyboar
throw new RuntimeException("We have an auto-correction but the typed word "
+ "is empty? Impossible! I must commit suicide.");
}
- Utils.Stats.onAutoCorrection(typedWord, autoCorrection.toString(), separatorCode);
+ Utils.Stats.onAutoCorrection(typedWord, autoCorrection.toString(), separatorCodePoint);
mExpectingUpdateSelection = true;
commitBestWord(autoCorrection);
if (!autoCorrection.equals(typedWord)) {
@@ -1881,15 +1882,13 @@ public class LatinIME extends InputMethodServiceCompatWrapper implements Keyboar
// Add the word to the user unigram dictionary if it's not a known word
addToUserUnigramAndBigramDictionaries(autoCorrection,
UserUnigramDictionary.FREQUENCY_FOR_TYPED);
- if (!typedWord.equals(autoCorrection)) {
+ if (!typedWord.equals(autoCorrection) && null != ic) {
// This will make the correction flash for a short while as a visual clue
// to the user that auto-correction happened.
InputConnectionCompatUtils.commitCorrection(ic,
mLastSelectionEnd - typedWord.length(), typedWord, autoCorrection);
}
- return true;
}
- return false;
}
@Override