aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJean Chalard <jchalard@google.com>2013-12-26 23:59:24 -0800
committerAndroid Git Automerger <android-git-automerger@android.com>2013-12-26 23:59:24 -0800
commitd2c0bed0527e5394c300df5db10b69852343c29e (patch)
tree82a729a360918cf7c37b96595dc923e37b194360
parent3735857dc9fb92e8f89e909b00587152f9d096b4 (diff)
parent2fc1cc099f27442c9a3f93f8a49dd333c83a2abe (diff)
downloadlatinime-d2c0bed0527e5394c300df5db10b69852343c29e.tar.gz
latinime-d2c0bed0527e5394c300df5db10b69852343c29e.tar.xz
latinime-d2c0bed0527e5394c300df5db10b69852343c29e.zip
am 2fc1cc09: Merge "[IL45] Remove lingering messages"
* commit '2fc1cc099f27442c9a3f93f8a49dd333c83a2abe': [IL45] Remove lingering messages
-rw-r--r--java/src/com/android/inputmethod/latin/LatinIME.java13
1 files changed, 9 insertions, 4 deletions
diff --git a/java/src/com/android/inputmethod/latin/LatinIME.java b/java/src/com/android/inputmethod/latin/LatinIME.java
index b10462c46..f90cf2f66 100644
--- a/java/src/com/android/inputmethod/latin/LatinIME.java
+++ b/java/src/com/android/inputmethod/latin/LatinIME.java
@@ -1345,6 +1345,7 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
private void updateBatchInput(final InputPointers batchPointers,
final int sequenceNumber, final boolean forEnd) {
synchronized (mLock) {
+ mHandler.removeMessages(MSG_UPDATE_GESTURE_PREVIEW_AND_SUGGESTION_STRIP);
if (!mInBatchInput) {
// Batch input has ended or canceled while the message was being delivered.
return;
@@ -1381,11 +1382,14 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
// Called on the UI thread by LatinIME.
public void onUpdateBatchInput(final InputPointers batchPointers,
final int sequenceNumber) {
- if (mHandler.hasMessages(MSG_UPDATE_GESTURE_PREVIEW_AND_SUGGESTION_STRIP)) {
- return;
+ synchronized (mLock) {
+ if (mHandler.hasMessages(MSG_UPDATE_GESTURE_PREVIEW_AND_SUGGESTION_STRIP)) {
+ return;
+ }
+ mHandler.obtainMessage(MSG_UPDATE_GESTURE_PREVIEW_AND_SUGGESTION_STRIP,
+ 0 /* arg1 */,sequenceNumber /* arg2 */,
+ batchPointers /* obj */).sendToTarget();
}
- mHandler.obtainMessage(MSG_UPDATE_GESTURE_PREVIEW_AND_SUGGESTION_STRIP, 0 /* arg1 */,
- sequenceNumber /* arg2 */, batchPointers /* obj */).sendToTarget();
}
/**
@@ -1398,6 +1402,7 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
// Called on the UI thread by LatinIME.
public void onCancelBatchInput() {
synchronized (mLock) {
+ mHandler.removeMessages(MSG_UPDATE_GESTURE_PREVIEW_AND_SUGGESTION_STRIP);
mInBatchInput = false;
}
}