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

Commit 929bfdd0 authored by Tadashi G. Takaoka's avatar Tadashi G. Takaoka Committed by Android (Google) Code Review
Browse files

Merge "Update shift state only when input field is restarted" into jb-mr1.1-dev

parents 4826c3ff d0725a68
Loading
Loading
Loading
Loading
+5 −10
Original line number Original line Diff line number Diff line
@@ -711,8 +711,6 @@ public final class LatinIME extends InputMethodService implements KeyboardAction
            accessUtils.onStartInputViewInternal(mainKeyboardView, editorInfo, restarting);
            accessUtils.onStartInputViewInternal(mainKeyboardView, editorInfo, restarting);
        }
        }


        final boolean selectionChanged = mLastSelectionStart != editorInfo.initialSelStart
                || mLastSelectionEnd != editorInfo.initialSelEnd;
        final boolean inputTypeChanged = !mCurrentSettings.isSameInputType(editorInfo);
        final boolean inputTypeChanged = !mCurrentSettings.isSameInputType(editorInfo);
        final boolean isDifferentTextField = !restarting || inputTypeChanged;
        final boolean isDifferentTextField = !restarting || inputTypeChanged;
        if (isDifferentTextField) {
        if (isDifferentTextField) {
@@ -760,20 +758,17 @@ public final class LatinIME extends InputMethodService implements KeyboardAction
            // TODO: Come up with a more comprehensive way to reset the keyboard layout when
            // TODO: Come up with a more comprehensive way to reset the keyboard layout when
            // a keyboard layout set doesn't get reloaded in this method.
            // a keyboard layout set doesn't get reloaded in this method.
            switcher.resetKeyboardStateToAlphabet();
            switcher.resetKeyboardStateToAlphabet();
            // In apps like Talk, we come here when the text is sent and the field gets emptied and
            // we need to re-evaluate the shift state, but not the whole layout which would be
            // disruptive.
            // Space state must be updated before calling updateShiftState
            switcher.updateShiftState();
        }
        }
        setSuggestionStripShownInternal(
        setSuggestionStripShownInternal(
                isSuggestionsStripVisible(), /* needsInputViewShown */ false);
                isSuggestionsStripVisible(), /* needsInputViewShown */ false);


        mLastSelectionStart = editorInfo.initialSelStart;
        mLastSelectionStart = editorInfo.initialSelStart;
        mLastSelectionEnd = editorInfo.initialSelEnd;
        mLastSelectionEnd = editorInfo.initialSelEnd;
        // If we come here something in the text state is very likely to have changed.
        // We should update the shift state regardless of whether we are restarting or not, because
        // this is not perceived as a layout change that may be disruptive like we may have with
        // switcher.loadKeyboard; in apps like Talk, we come here when the text is sent and the
        // field gets emptied and we need to re-evaluate the shift state, but not the whole layout
        // which would be disruptive.
        // Space state must be updated before calling updateShiftState
        mKeyboardSwitcher.updateShiftState();


        mHandler.cancelUpdateSuggestionStrip();
        mHandler.cancelUpdateSuggestionStrip();
        mHandler.cancelDoubleSpacesTimer();
        mHandler.cancelDoubleSpacesTimer();