diff options
author | 2012-06-28 22:58:22 -0700 | |
---|---|---|
committer | 2012-06-28 22:58:22 -0700 | |
commit | 4447a8ec6a1441d1ad4cd02462e79110a060fdc6 (patch) | |
tree | e935e6107f40e68953814ce73cf3caa2675b177c /java/src | |
parent | 737c87a5f183765e8a5317accac329de202e736f (diff) | |
parent | 305326e789c3a89517855cc5a023ed1aa3074dc0 (diff) | |
download | latinime-4447a8ec6a1441d1ad4cd02462e79110a060fdc6.tar.gz latinime-4447a8ec6a1441d1ad4cd02462e79110a060fdc6.tar.xz latinime-4447a8ec6a1441d1ad4cd02462e79110a060fdc6.zip |
Merge "Refactoring and add debug prints (A9)"
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(); |