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

Commit 1eff7d77 authored by Tadashi G. Takaoka's avatar Tadashi G. Takaoka
Browse files

Remove mIsApplicationSpecifiedCompletions flags from SuggestedWords

Bug: 3504990
Change-Id: Ib7588ab05fa8b8ab58bf3bea6ff1f644c53ebb94
parent c2bbc6a4
Loading
Loading
Loading
Loading
+0 −3
Original line number Diff line number Diff line
@@ -347,9 +347,6 @@ public class CandidateView extends LinearLayout implements OnClickListener, OnLo
        if (mShowingAddToDictionary && index == 0) {
            addToDictionary(word);
        } else {
            if (!mSuggestions.mIsApplicationSpecifiedCompletions) {
                TextEntryState.acceptedSuggestion(mSuggestions.getWord(0), word);
            }
            mService.pickSuggestionManually(index, word);
        }
    }
+1 −0
Original line number Diff line number Diff line
@@ -1636,6 +1636,7 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
            return;
        }

        TextEntryState.acceptedSuggestion(suggestions.getWord(0), suggestion);
        // If this is a punctuation, apply it through the normal key press
        if (suggestion.length() == 1 && (isWordSeparator(suggestion.charAt(0))
                || isSuggestedPunctuation(suggestion.charAt(0)))) {
+5 −11
Original line number Diff line number Diff line
@@ -24,23 +24,20 @@ import java.util.HashSet;
import java.util.List;

public class SuggestedWords {
    public static final SuggestedWords EMPTY = new SuggestedWords(null, false, false, false, null);
    public static final SuggestedWords EMPTY = new SuggestedWords(null, false, false, null);

    public final List<CharSequence> mWords;
    public final boolean mIsApplicationSpecifiedCompletions;
    public final boolean mTypedWordValid;
    public final boolean mHasMinimalSuggestion;
    public final List<SuggestedWordInfo> mSuggestedWordInfoList;

    private SuggestedWords(List<CharSequence> words, boolean isApplicationSpecifiedCompletions,
            boolean typedWordValid, boolean hasMinamlSuggestion,
            List<SuggestedWordInfo> suggestedWordInfoList) {
    private SuggestedWords(List<CharSequence> words, boolean typedWordValid,
            boolean hasMinamlSuggestion, List<SuggestedWordInfo> suggestedWordInfoList) {
        if (words != null) {
            mWords = words;
        } else {
            mWords = Collections.emptyList();
        }
        mIsApplicationSpecifiedCompletions = isApplicationSpecifiedCompletions;
        mTypedWordValid = typedWordValid;
        mHasMinimalSuggestion = hasMinamlSuggestion;
        mSuggestedWordInfoList = suggestedWordInfoList;
@@ -64,7 +61,6 @@ public class SuggestedWords {

    public static class Builder {
        private List<CharSequence> mWords = new ArrayList<CharSequence>();
        private boolean mIsCompletions;
        private boolean mTypedWordValid;
        private boolean mHasMinimalSuggestion;
        private List<SuggestedWordInfo> mSuggestedWordInfoList =
@@ -109,7 +105,6 @@ public class SuggestedWords {
        public Builder setApplicationSpecifiedCompletions(CompletionInfo[] infos) {
            for (CompletionInfo info : infos)
                addWord(info.getText());
            mIsCompletions = true;
            return this;
        }

@@ -141,15 +136,14 @@ public class SuggestedWords {
                    alreadySeen.add(prevWord);
                }
            }
            mIsCompletions = false;
            mTypedWordValid = false;
            mHasMinimalSuggestion = false;
            return this;
        }

        public SuggestedWords build() {
            return new SuggestedWords(mWords, mIsCompletions, mTypedWordValid,
                    mHasMinimalSuggestion, mSuggestedWordInfoList);
            return new SuggestedWords(mWords, mTypedWordValid, mHasMinimalSuggestion,
                    mSuggestedWordInfoList);
        }

        public int size() {