diff options
author | 2010-12-03 19:40:31 +0900 | |
---|---|---|
committer | 2010-12-06 23:35:32 +0900 | |
commit | d024ea605cc6b5b0b9fa1bd838d5b0ebd3901a5d (patch) | |
tree | e17fe10b112759d403042eab56ff4e5c34c6de17 /java/src | |
parent | 4e24668a7568449b0372ab67936a76656eb90785 (diff) | |
download | latinime-d024ea605cc6b5b0b9fa1bd838d5b0ebd3901a5d.tar.gz latinime-d024ea605cc6b5b0b9fa1bd838d5b0ebd3901a5d.tar.xz latinime-d024ea605cc6b5b0b9fa1bd838d5b0ebd3901a5d.zip |
Fix an issue with lingering composing span underline after orientation changes
bug: 3246868
Change-Id: Id3887953e195281d677f31fba5feca1e60016bfa
Diffstat (limited to 'java/src')
-rw-r--r-- | java/src/com/android/inputmethod/latin/LatinIME.java | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/java/src/com/android/inputmethod/latin/LatinIME.java b/java/src/com/android/inputmethod/latin/LatinIME.java index 702731e6d..3089153ad 100644 --- a/java/src/com/android/inputmethod/latin/LatinIME.java +++ b/java/src/com/android/inputmethod/latin/LatinIME.java @@ -645,13 +645,18 @@ public class LatinIME extends InputMethodService } private void checkReCorrectionOnStart() { - if (mReCorrectionEnabled && isSuggestionShown() && isPredictionOn()) { + if (!mReCorrectionEnabled) return; + + final InputConnection ic = getCurrentInputConnection(); + if (ic == null) return; + // There could be a pending composing span. Clean it up first. + ic.finishComposingText(); + + if (isSuggestionShown() && isPredictionOn()) { // First get the cursor position. This is required by setOldSuggestions(), so that // it can pass the correct range to setComposingRegion(). At this point, we don't // have valid values for mLastSelectionStart/Stop because onUpdateSelection() has // not been called yet. - InputConnection ic = getCurrentInputConnection(); - if (ic == null) return; ExtractedTextRequest etr = new ExtractedTextRequest(); etr.token = 0; // anything is fine here ExtractedText et = ic.getExtractedText(etr, 0); @@ -677,8 +682,7 @@ public class LatinIME extends InputMethodService mVoiceConnector.flushVoiceInputLogs(mConfigurationChanging); KeyboardView inputView = mKeyboardSwitcher.getInputView(); - if (inputView != null) - inputView.closing(); + if (inputView != null) inputView.closing(); if (mAutoDictionary != null) mAutoDictionary.flushPendingWrites(); if (mUserBigramDictionary != null) mUserBigramDictionary.flushPendingWrites(); } @@ -687,8 +691,7 @@ public class LatinIME extends InputMethodService public void onFinishInputView(boolean finishingInput) { super.onFinishInputView(finishingInput); KeyboardView inputView = mKeyboardSwitcher.getInputView(); - if (inputView != null) - inputView.setForeground(false); + if (inputView != null) inputView.setForeground(false); // Remove pending messages related to update suggestions mHandler.cancelUpdateSuggestions(); mHandler.cancelUpdateOldSuggestions(); |