From 2a5ec00301435bdb70913bb18a72a022e7b16a92 Mon Sep 17 00:00:00 2001 From: Jean Chalard Date: Fri, 21 Feb 2014 16:43:11 +0900 Subject: [PATCH] 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 --- .../com/android/inputmethod/latin/inputlogic/InputLogic.java | 2 ++ 1 file changed, 2 insertions(+) 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