diff options
author | 2012-09-12 12:40:36 +0900 | |
---|---|---|
committer | 2012-09-13 17:35:26 +0900 | |
commit | 5ed88457bf9ef3305d4a5aa4ac05b513433ad0dd (patch) | |
tree | e196a5938faf494108e9f4f3c1ea03789890a788 /java/src/com/android/inputmethod/latin/LatinIME.java | |
parent | 18fc3bf4c453fe106be254eeb7aefb4a4a7154ba (diff) | |
download | latinime-5ed88457bf9ef3305d4a5aa4ac05b513433ad0dd.tar.gz latinime-5ed88457bf9ef3305d4a5aa4ac05b513433ad0dd.tar.xz latinime-5ed88457bf9ef3305d4a5aa4ac05b513433ad0dd.zip |
Make onUpdateSelection much more resilient to race conditions.
This is pretty much as strong as it gets. It should be
impossible to get false positives and nearly impossible to
get true negatives with this new code.
Bug: 6981089
Change-Id: Ia32ab62f89c5943f0be169b979abab652e67bf5b
Diffstat (limited to 'java/src/com/android/inputmethod/latin/LatinIME.java')
-rw-r--r-- | java/src/com/android/inputmethod/latin/LatinIME.java | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/java/src/com/android/inputmethod/latin/LatinIME.java b/java/src/com/android/inputmethod/latin/LatinIME.java index 78c65e0c7..b3f7e674d 100644 --- a/java/src/com/android/inputmethod/latin/LatinIME.java +++ b/java/src/com/android/inputmethod/latin/LatinIME.java @@ -825,7 +825,8 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen // we know for sure the cursor moved while we were composing and we should reset // the state. final boolean noComposingSpan = composingSpanStart == -1 && composingSpanEnd == -1; - if (!mExpectingUpdateSelection) { + if (!mExpectingUpdateSelection + && !mConnection.isBelatedExpectedUpdate(oldSelStart, newSelStart)) { // TAKE CARE: there is a race condition when we enter this test even when the user // did not explicitly move the cursor. This happens when typing fast, where two keys // turn this flag on in succession and both onUpdateSelection() calls arrive after |