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

Commit 6ffb5018 authored by Jean Chalard's avatar Jean Chalard
Browse files

Straighten out the last bastion of the Builder

...and go for the kill

Change-Id: I5ad57211b250d2578ca22a5dae93344d52f9da80
parent ec471c72
Loading
Loading
Loading
Loading
+9 −2
Original line number Diff line number Diff line
@@ -437,13 +437,20 @@ public class Suggest implements Dictionary.WordCallback {
        }
        // Don't auto-correct words with multiple capital letter
        autoCorrectionAvailable &= !wordComposer.isMostlyCaps();
        final boolean shouldBlockAutoCorrectionBySatefyNet;
        if (allowsToBeAutoCorrected && scoreInfoList.size() > 1 && mAutoCorrectionThreshold > 0
                && Suggest.shouldBlockAutoCorrectionBySafetyNet(typedWord,
                        scoreInfoList.get(1).mWord)) {
            shouldBlockAutoCorrectionBySatefyNet = true;
        } else {
            shouldBlockAutoCorrectionBySatefyNet = false;
        }
        builder = new SuggestedWords.Builder(scoreInfoList,
                !allowsToBeAutoCorrected /* typedWordValid */,
                autoCorrectionAvailable /* hasMinimalSuggestion */,
                allowsToBeAutoCorrected /* allowsToBeAutoCorrected */,
                false /* isPunctuationSuggestions */);
        if (allowsToBeAutoCorrected && builder.size() > 1 && mAutoCorrectionThreshold > 0
                && Suggest.shouldBlockAutoCorrectionBySafetyNet(typedWord, builder.getWord(1))) {
        if (shouldBlockAutoCorrectionBySatefyNet) {
            builder.setShouldBlockAutoCorrectionBySafetyNet();
        }
        return builder;
+1 −1
Original line number Diff line number Diff line
@@ -170,7 +170,7 @@ public class SuggestedWords {
    }

    public static class SuggestedWordInfo {
        private final CharSequence mWord;
        public final CharSequence mWord;
        private final CharSequence mDebugString;
        private final boolean mPreviousSuggestedWord;