Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 2a5ec003 authored by Jean Chalard's avatar Jean Chalard
Browse files

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
parent 1b3a142c
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -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