diff options
author | 2013-05-08 18:44:50 +0900 | |
---|---|---|
committer | 2013-05-08 18:47:10 +0900 | |
commit | 9f9cc032773a528b4eb6e036db0c37ff45385cce (patch) | |
tree | 403073271db2206f6dd72bd8d08755bdda9ef147 /java/src/com/android/inputmethod/latin/RichInputConnection.java | |
parent | faa94a2d0abfc8e0f03799dd5f0f2125e44b0bfd (diff) | |
download | latinime-9f9cc032773a528b4eb6e036db0c37ff45385cce.tar.gz latinime-9f9cc032773a528b4eb6e036db0c37ff45385cce.tar.xz latinime-9f9cc032773a528b4eb6e036db0c37ff45385cce.zip |
Optimizations and safeguards.
- Don't call finishComposingText when useless.
- Add safeguards against calling setComposingRegion when the
data returned by the editor is inconsistent.
- Cancel pending recorrection messages when new messages arrive.
Bug: 8842941
Bug: 8845001
Change-Id: I939701033cf5c2bbd85871ecf83e329021ddeb91
Diffstat (limited to 'java/src/com/android/inputmethod/latin/RichInputConnection.java')
-rw-r--r-- | java/src/com/android/inputmethod/latin/RichInputConnection.java | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/java/src/com/android/inputmethod/latin/RichInputConnection.java b/java/src/com/android/inputmethod/latin/RichInputConnection.java index 8ed7ab264..980215de6 100644 --- a/java/src/com/android/inputmethod/latin/RichInputConnection.java +++ b/java/src/com/android/inputmethod/latin/RichInputConnection.java @@ -135,13 +135,14 @@ public final class RichInputConnection { if (DEBUG_PREVIOUS_TEXT) checkConsistencyForDebug(); } - public void resetCachesUponCursorMove(final int newCursorPosition) { + public void resetCachesUponCursorMove(final int newCursorPosition, + final boolean shouldFinishComposition) { mCurrentCursorPosition = newCursorPosition; mComposingText.setLength(0); mCommittedTextBeforeComposingText.setLength(0); final CharSequence textBeforeCursor = getTextBeforeCursor(DEFAULT_TEXT_CACHE_SIZE, 0); if (null != textBeforeCursor) mCommittedTextBeforeComposingText.append(textBeforeCursor); - if (null != mIC) { + if (null != mIC && shouldFinishComposition) { mIC.finishComposingText(); if (ProductionFlag.USES_DEVELOPMENT_ONLY_DIAGNOSTICS) { ResearchLogger.richInputConnection_finishComposingText(); |