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

Commit b5880034 authored by Jean Chalard's avatar Jean Chalard
Browse files

Refactoring.

Small simplification of the code.

Change-Id: I1f67ae529bbb2c9316bf5e083d367c57040ea22c
parent e35e13fc
Loading
Loading
Loading
Loading
+15 −17
Original line number Diff line number Diff line
@@ -1586,7 +1586,6 @@ public class LatinIME extends InputMethodServiceCompatWrapper implements Keyboar
            mHandler.postUpdateSuggestions();
        }

        boolean pickedDefault = false;
        // Handle separator
        final InputConnection ic = getCurrentInputConnection();
        if (ic != null) {
@@ -1603,13 +1602,8 @@ public class LatinIME extends InputMethodServiceCompatWrapper implements Keyboar
            final boolean shouldAutoCorrect = mSettingsValues.mAutoCorrectEnabled
                    && !mInputTypeNoAutoCorrect;
            if (shouldAutoCorrect && primaryCode != Keyboard.CODE_SINGLE_QUOTE) {
                pickedDefault = pickDefaultSuggestion(primaryCode);
            } else {
                commitTyped(ic);
            }
        }

        if (pickedDefault) {
                final boolean pickedDefaultSuggestion = pickDefaultSuggestion(primaryCode);
                if (pickedDefaultSuggestion) {
                    final CharSequence autoCorrection = mWordComposer.getAutoCorrectionOrNull();
                    final String typedWord = mWordComposer.getTypedWord();
                    if (TextUtils.isEmpty(typedWord)) {
@@ -1619,8 +1613,12 @@ public class LatinIME extends InputMethodServiceCompatWrapper implements Keyboar
                    if (!typedWord.equals(autoCorrection)) {
                        // This will make the correction flash for a short while as a visual clue
                        // to the user that auto-correction happened.
                InputConnectionCompatUtils.commitCorrection(
                        ic, mLastSelectionEnd - typedWord.length(), typedWord, autoCorrection);
                        InputConnectionCompatUtils.commitCorrection(ic,
                                mLastSelectionEnd - typedWord.length(), typedWord, autoCorrection);
                    }
                }
            } else {
                commitTyped(ic);
            }
        }