diff options
author | 2012-02-19 18:02:40 -0800 | |
---|---|---|
committer | 2012-02-19 18:02:40 -0800 | |
commit | 5eeff7cf547e3694315473a91bed0d5afdc5709e (patch) | |
tree | 0aa72f4cc77b2ae290e7fd1811c2efd4b22d8b3e /java/src | |
parent | 104453908064dcdbb4f10aa4150f1d79beafb408 (diff) | |
download | latinime-5eeff7cf547e3694315473a91bed0d5afdc5709e.tar.gz latinime-5eeff7cf547e3694315473a91bed0d5afdc5709e.tar.xz latinime-5eeff7cf547e3694315473a91bed0d5afdc5709e.zip |
Converge paths of an if() branch
This is to help with further refactoring.
Change-Id: Ib2459903862570cf7022fd90f2d5c524a6bbbe19
Diffstat (limited to 'java/src')
-rw-r--r-- | java/src/com/android/inputmethod/latin/LatinIME.java | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/java/src/com/android/inputmethod/latin/LatinIME.java b/java/src/com/android/inputmethod/latin/LatinIME.java index ce306eaad..dcb114682 100644 --- a/java/src/com/android/inputmethod/latin/LatinIME.java +++ b/java/src/com/android/inputmethod/latin/LatinIME.java @@ -903,10 +903,20 @@ public class LatinIME extends InputMethodServiceCompatWrapper implements Keyboar mComposingStateManager.onFinishComposingText(); mVoiceProxy.setVoiceInputHighlighted(false); } else if (!mWordComposer.isComposingWord()) { - // TODO: is the following reset still needed, given that we are not composing - // a word? + // We need to do this to clear the last composed word. resetComposingState(true /* alsoResetLastComposedWord */); updateSuggestions(); + // Calling finishComposingText() here is harmless because there + // is no composing word, so it's a no-op. + final InputConnection ic = getCurrentInputConnection(); + if (ic != null) { + ic.finishComposingText(); + } + // Likewise, this is a no-op since we are not composing text + mComposingStateManager.onFinishComposingText(); + // The cursor moved so it's safe to assume that the voice input + // is not highlighted + mVoiceProxy.setVoiceInputHighlighted(false); } mHandler.postUpdateShiftState(); |