Merge "[IL45] Remove lingering messages"
This commit is contained in:
commit
2fc1cc099f
1 changed files with 9 additions and 4 deletions
|
@ -1345,6 +1345,7 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
|
||||||
private void updateBatchInput(final InputPointers batchPointers,
|
private void updateBatchInput(final InputPointers batchPointers,
|
||||||
final int sequenceNumber, final boolean forEnd) {
|
final int sequenceNumber, final boolean forEnd) {
|
||||||
synchronized (mLock) {
|
synchronized (mLock) {
|
||||||
|
mHandler.removeMessages(MSG_UPDATE_GESTURE_PREVIEW_AND_SUGGESTION_STRIP);
|
||||||
if (!mInBatchInput) {
|
if (!mInBatchInput) {
|
||||||
// Batch input has ended or canceled while the message was being delivered.
|
// Batch input has ended or canceled while the message was being delivered.
|
||||||
return;
|
return;
|
||||||
|
@ -1381,11 +1382,14 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
|
||||||
// Called on the UI thread by LatinIME.
|
// Called on the UI thread by LatinIME.
|
||||||
public void onUpdateBatchInput(final InputPointers batchPointers,
|
public void onUpdateBatchInput(final InputPointers batchPointers,
|
||||||
final int sequenceNumber) {
|
final int sequenceNumber) {
|
||||||
|
synchronized (mLock) {
|
||||||
if (mHandler.hasMessages(MSG_UPDATE_GESTURE_PREVIEW_AND_SUGGESTION_STRIP)) {
|
if (mHandler.hasMessages(MSG_UPDATE_GESTURE_PREVIEW_AND_SUGGESTION_STRIP)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
mHandler.obtainMessage(MSG_UPDATE_GESTURE_PREVIEW_AND_SUGGESTION_STRIP, 0 /* arg1 */,
|
mHandler.obtainMessage(MSG_UPDATE_GESTURE_PREVIEW_AND_SUGGESTION_STRIP,
|
||||||
sequenceNumber /* arg2 */, batchPointers /* obj */).sendToTarget();
|
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.
|
// Called on the UI thread by LatinIME.
|
||||||
public void onCancelBatchInput() {
|
public void onCancelBatchInput() {
|
||||||
synchronized (mLock) {
|
synchronized (mLock) {
|
||||||
|
mHandler.removeMessages(MSG_UPDATE_GESTURE_PREVIEW_AND_SUGGESTION_STRIP);
|
||||||
mInBatchInput = false;
|
mInBatchInput = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue