From 61cc2a33911ff2a8115ce727c8cac6d73d989c42 Mon Sep 17 00:00:00 2001 From: Jean Chalard Date: Fri, 9 Nov 2012 18:58:50 +0900 Subject: [PATCH] Don't restrict reset composing state to non-identical setText Bug: 7497063 Change-Id: Ifbd5c37408131867458fd921bdef46ef90d81478 --- .../android/inputmethod/latin/LatinIME.java | 24 ++++++++----------- 1 file changed, 10 insertions(+), 14 deletions(-) diff --git a/java/src/com/android/inputmethod/latin/LatinIME.java b/java/src/com/android/inputmethod/latin/LatinIME.java index cf7eea70b..9dd5351f9 100644 --- a/java/src/com/android/inputmethod/latin/LatinIME.java +++ b/java/src/com/android/inputmethod/latin/LatinIME.java @@ -704,21 +704,17 @@ public final class LatinIME extends InputMethodService implements KeyboardAction updateFullscreenMode(); mApplicationSpecifiedCompletions = null; - if (isDifferentTextField || selectionChanged) { - // If the selection changed, we reset the input state. Essentially, we come here with - // restarting == true when the app called setText() or similar. We should reset the - // state if the app set the text to something else, but keep it if it set a suggestion - // or something. - mEnteredText = null; - resetComposingState(true /* alsoResetLastComposedWord */); - mDeleteCount = 0; - mSpaceState = SPACE_STATE_NONE; + // The app calling setText() has the effect of clearing the composing + // span, so we should reset our state unconditionally, even if restarting is true. + mEnteredText = null; + resetComposingState(true /* alsoResetLastComposedWord */); + mDeleteCount = 0; + mSpaceState = SPACE_STATE_NONE; - if (mSuggestionStripView != null) { - // This will set the punctuation suggestions if next word suggestion is off; - // otherwise it will clear the suggestion strip. - setPunctuationSuggestions(); - } + if (mSuggestionStripView != null) { + // This will set the punctuation suggestions if next word suggestion is off; + // otherwise it will clear the suggestion strip. + setPunctuationSuggestions(); } mConnection.resetCachesUponCursorMove(editorInfo.initialSelStart);