aboutsummaryrefslogtreecommitdiffstats
path: root/java/src
diff options
context:
space:
mode:
authorJean Chalard <jchalard@google.com>2013-12-27 07:56:44 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2013-12-27 07:56:44 +0000
commit2fc1cc099f27442c9a3f93f8a49dd333c83a2abe (patch)
tree82a729a360918cf7c37b96595dc923e37b194360 /java/src
parent0d212235211e5860242baf4c77a25ae2166b5498 (diff)
parent31ff2a4335d6cea0a5ebc11268833ceb99a4fa72 (diff)
downloadlatinime-2fc1cc099f27442c9a3f93f8a49dd333c83a2abe.tar.gz
latinime-2fc1cc099f27442c9a3f93f8a49dd333c83a2abe.tar.xz
latinime-2fc1cc099f27442c9a3f93f8a49dd333c83a2abe.zip
Merge "[IL45] Remove lingering messages"
Diffstat (limited to 'java/src')
-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;
}
}