diff options
author | 2012-06-28 15:48:23 +0900 | |
---|---|---|
committer | 2012-06-29 14:24:54 +0900 | |
commit | 305326e789c3a89517855cc5a023ed1aa3074dc0 (patch) | |
tree | ac3e364f8f747db97d041129a9082ffdbcf9666a /java/src | |
parent | 06bc7fedbda5ee6d0edb62f0681a2b9da01032c7 (diff) | |
download | latinime-305326e789c3a89517855cc5a023ed1aa3074dc0.tar.gz latinime-305326e789c3a89517855cc5a023ed1aa3074dc0.tar.xz latinime-305326e789c3a89517855cc5a023ed1aa3074dc0.zip |
Refactoring and add debug prints (A9)
Change-Id: I46497bff107f0def0dfa2b043b20d9a0b0cde040
Diffstat (limited to 'java/src')
-rw-r--r-- | java/src/com/android/inputmethod/latin/LatinIME.java | 17 |
1 files changed, 13 insertions, 4 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(); |