aboutsummaryrefslogtreecommitdiffstats
path: root/java/src/com/android/inputmethod/latin/inputlogic/InputLogic.java
diff options
context:
space:
mode:
authorJean Chalard <jchalard@google.com>2014-02-21 16:43:11 +0900
committerJean Chalard <jchalard@google.com>2014-02-21 16:43:11 +0900
commit2a5ec00301435bdb70913bb18a72a022e7b16a92 (patch)
tree03c4f1c6a55e296616c48f5f63fc17d18c46ac4e /java/src/com/android/inputmethod/latin/inputlogic/InputLogic.java
parent1b3a142cace93ab22064ae5cf5f2d2ff7635ae9e (diff)
downloadlatinime-2a5ec00301435bdb70913bb18a72a022e7b16a92.tar.gz
latinime-2a5ec00301435bdb70913bb18a72a022e7b16a92.tar.xz
latinime-2a5ec00301435bdb70913bb18a72a022e7b16a92.zip
Don't trim newer inputpointers with old data
We already have a mechanism to avoid this crash, but it wasn't used every time it needed to. It's possible that ending a batch input and starting a batch input happen while suggestions are being pulled out, which would result in pointers that have been reset being passed for trimming. Just increasing the sequence number should get rid of the problem. Bug: 12178124 Change-Id: I36ef3bc8a78679bc09daa39e665f5ce1bab50c2a
Diffstat (limited to 'java/src/com/android/inputmethod/latin/inputlogic/InputLogic.java')
-rw-r--r--java/src/com/android/inputmethod/latin/inputlogic/InputLogic.java2
1 files changed, 2 insertions, 0 deletions
diff --git a/java/src/com/android/inputmethod/latin/inputlogic/InputLogic.java b/java/src/com/android/inputmethod/latin/inputlogic/InputLogic.java
index eeb5bf536..045d06f0e 100644
--- a/java/src/com/android/inputmethod/latin/inputlogic/InputLogic.java
+++ b/java/src/com/android/inputmethod/latin/inputlogic/InputLogic.java
@@ -490,6 +490,7 @@ public final class InputLogic {
handler.showGesturePreviewAndSuggestionStrip(
SuggestedWords.EMPTY, false /* dismissGestureFloatingPreviewText */);
handler.cancelUpdateSuggestionStrip();
+ ++mAutoCommitSequenceNumber;
mConnection.beginBatchEdit();
if (mWordComposer.isComposingWord()) {
if (settingsValues.mIsInternal) {
@@ -587,6 +588,7 @@ public final class InputLogic {
public void onEndBatchInput(final SettingsValues settingValues,
final InputPointers batchPointers) {
mInputLogicHandler.onEndBatchInput(batchPointers, mAutoCommitSequenceNumber);
+ ++mAutoCommitSequenceNumber;
}
// TODO: remove this argument