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

Commit 2245c3b5 authored by Jean Chalard's avatar Jean Chalard
Browse files

Refactor + small bugfix

postUpdateShiftKeyState used to be called also when
mEnteredText is not null => this is a bugfix.
The rest does not change the logic, as posting a message can
be done anywhere within the function with no impact.

Change-Id: I7888797c0778702d64f96701e35b611a55a6a259
parent a2a85d45
Loading
Loading
Loading
Loading
+3 −4
Original line number Diff line number Diff line
@@ -1397,6 +1397,9 @@ public class LatinIME extends InputMethodServiceCompatWrapper implements Keyboar
    private void handleBackspaceWhileInBatchEdit(final int spaceState, final InputConnection ic) {
        mVoiceProxy.handleBackspace();

        // In many cases, we may have to put the keyboard in auto-shift state again.
        mHandler.postUpdateShiftKeyState();

        if (mEnteredText != null && sameAsTextBeforeCursor(ic, mEnteredText)) {
            // Cancel multi-character input: remove the text we just entered.
            // This is triggered on backspace after a key that inputs multiple characters,
@@ -1433,14 +1436,10 @@ public class LatinIME extends InputMethodServiceCompatWrapper implements Keyboar
            } else {
                ic.deleteSurroundingText(1, 0);
            }
            // If we deleted the last remaining char of a word, we may have to put the keyboard
            // in auto-shift state again.
            mHandler.postUpdateShiftKeyState();
            // If we had uncommitted chars then we know it's not time to revert any auto-correct
            // and that spaceState is NONE.
            return;
        }
        mHandler.postUpdateShiftKeyState();

        if (null != mWordSavedForAutoCorrectCancellation) {
            Utils.Stats.onAutoCorrectionCancellation();