From 1eff7d77c8acaedf043bf00a0b8e750804f64444 Mon Sep 17 00:00:00 2001 From: "Tadashi G. Takaoka" Date: Wed, 2 Mar 2011 17:17:15 -0800 Subject: [PATCH] Remove mIsApplicationSpecifiedCompletions flags from SuggestedWords Bug: 3504990 Change-Id: Ib7588ab05fa8b8ab58bf3bea6ff1f644c53ebb94 --- .../android/inputmethod/latin/CandidateView.java | 3 --- .../com/android/inputmethod/latin/LatinIME.java | 1 + .../inputmethod/latin/SuggestedWords.java | 16 +++++----------- 3 files changed, 6 insertions(+), 14 deletions(-) diff --git a/java/src/com/android/inputmethod/latin/CandidateView.java b/java/src/com/android/inputmethod/latin/CandidateView.java index 9699ad136..5719b9012 100644 --- a/java/src/com/android/inputmethod/latin/CandidateView.java +++ b/java/src/com/android/inputmethod/latin/CandidateView.java @@ -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); } } diff --git a/java/src/com/android/inputmethod/latin/LatinIME.java b/java/src/com/android/inputmethod/latin/LatinIME.java index 838249a39..79181c6c9 100644 --- a/java/src/com/android/inputmethod/latin/LatinIME.java +++ b/java/src/com/android/inputmethod/latin/LatinIME.java @@ -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)))) { diff --git a/java/src/com/android/inputmethod/latin/SuggestedWords.java b/java/src/com/android/inputmethod/latin/SuggestedWords.java index f774ce3a5..fe7aac7c2 100644 --- a/java/src/com/android/inputmethod/latin/SuggestedWords.java +++ b/java/src/com/android/inputmethod/latin/SuggestedWords.java @@ -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 mWords; - public final boolean mIsApplicationSpecifiedCompletions; public final boolean mTypedWordValid; public final boolean mHasMinimalSuggestion; public final List mSuggestedWordInfoList; - private SuggestedWords(List words, boolean isApplicationSpecifiedCompletions, - boolean typedWordValid, boolean hasMinamlSuggestion, - List suggestedWordInfoList) { + private SuggestedWords(List words, boolean typedWordValid, + boolean hasMinamlSuggestion, List 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 mWords = new ArrayList(); - private boolean mIsCompletions; private boolean mTypedWordValid; private boolean mHasMinimalSuggestion; private List 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() {