aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--java/src/com/android/inputmethod/latin/LatinIME.java17
-rw-r--r--native/jni/Android.mk2
2 files changed, 14 insertions, 5 deletions
diff --git a/java/src/com/android/inputmethod/latin/LatinIME.java b/java/src/com/android/inputmethod/latin/LatinIME.java
index f806286d9..97665ecf6 100644
--- a/java/src/com/android/inputmethod/latin/LatinIME.java
+++ b/java/src/com/android/inputmethod/latin/LatinIME.java
@@ -1685,6 +1685,9 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
}
public void updateSuggestions() {
+ mHandler.cancelUpdateSuggestions();
+ mHandler.cancelUpdateBigramPredictions();
+
// Check if we have a suggestion engine attached.
if ((mSuggest == null || !mCurrentSettings.isSuggestionsRequested(mDisplayOrientation))) {
if (mWordComposer.isComposingWord()) {
@@ -1694,10 +1697,8 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
return;
}
- mHandler.cancelUpdateSuggestions();
- mHandler.cancelUpdateBigramPredictions();
-
if (!mWordComposer.isComposingWord()) {
+ // This is dead code: we can't come here with an empty word composer.
setPunctuationSuggestions();
return;
}
@@ -1908,8 +1909,16 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
}
public void updateBigramPredictions() {
- if (mSuggest == null || !mCurrentSettings.isSuggestionsRequested(mDisplayOrientation))
+ mHandler.cancelUpdateSuggestions();
+ mHandler.cancelUpdateBigramPredictions();
+
+ if (mSuggest == null || !mCurrentSettings.isSuggestionsRequested(mDisplayOrientation)) {
+ if (mWordComposer.isComposingWord()) {
+ Log.w(TAG, "Called updateBigramPredictions but suggestions were not requested!");
+ mWordComposer.setAutoCorrection(mWordComposer.getTypedWord());
+ }
return;
+ }
if (!mCurrentSettings.mBigramPredictionEnabled) {
setPunctuationSuggestions();
diff --git a/native/jni/Android.mk b/native/jni/Android.mk
index 237f19d45..df98680ca 100644
--- a/native/jni/Android.mk
+++ b/native/jni/Android.mk
@@ -17,7 +17,7 @@ LOCAL_PATH := $(call my-dir)
############ some local flags
# If you change any of those flags, you need to rebuild both libjni_latinime_static
# and the shared library.
-#FLAG_DBG := true
+FLAG_DBG ?= false
FLAG_DO_PROFILE ?= false
######################################