am e0c2e5b2: Merge "Remove a deprecated constructor to SuggestedWords"

* commit 'e0c2e5b2f731d612df5005c770ddd8cf47180e19':
  Remove a deprecated constructor to SuggestedWords
main
Jean Chalard 2014-11-07 08:52:25 +00:00 committed by Android Git Automerger
commit e96f2a2afb
2 changed files with 7 additions and 13 deletions

View File

@ -230,7 +230,7 @@ public final class Suggest {
inputStyle = inputStyleIfNotPrediction; inputStyle = inputStyleIfNotPrediction;
} }
callback.onGetSuggestedWords(new SuggestedWords(suggestionsList, callback.onGetSuggestedWords(new SuggestedWords(suggestionsList,
suggestionResults.mRawSuggestions, suggestionResults.mRawSuggestions, typedWord,
// TODO: this first argument is lying. If this is a whitelisted word which is an // TODO: this first argument is lying. If this is a whitelisted word which is an
// actual word, it says typedWordValid = false, which looks wrong. We should either // actual word, it says typedWordValid = false, which looks wrong. We should either
// rename the attribute or change the value. // rename the attribute or change the value.
@ -286,8 +286,12 @@ public final class Suggest {
// (typedWordValid=true), not as an "auto correct word" (willAutoCorrect=false). // (typedWordValid=true), not as an "auto correct word" (willAutoCorrect=false).
// Note that because this method is never used to get predictions, there is no need to // Note that because this method is never used to get predictions, there is no need to
// modify inputType such in getSuggestedWordsForNonBatchInput. // modify inputType such in getSuggestedWordsForNonBatchInput.
final String pseudoTypedWord = suggestionsContainer.isEmpty() ? null
: suggestionsContainer.get(0).mWord;
callback.onGetSuggestedWords(new SuggestedWords(suggestionsContainer, callback.onGetSuggestedWords(new SuggestedWords(suggestionsContainer,
suggestionResults.mRawSuggestions, suggestionResults.mRawSuggestions,
pseudoTypedWord,
true /* typedWordValid */, true /* typedWordValid */,
false /* willAutoCorrect */, false /* willAutoCorrect */,
false /* isObsoleteSuggestions */, false /* isObsoleteSuggestions */,

View File

@ -73,21 +73,11 @@ public class SuggestedWords {
final boolean willAutoCorrect, final boolean willAutoCorrect,
final boolean isObsoleteSuggestions, final boolean isObsoleteSuggestions,
final int inputStyle) { final int inputStyle) {
this(suggestedWordInfoList, rawSuggestions, typedWordValid, willAutoCorrect,
isObsoleteSuggestions, inputStyle, NOT_A_SEQUENCE_NUMBER);
}
public SuggestedWords(final ArrayList<SuggestedWordInfo> suggestedWordInfoList,
final ArrayList<SuggestedWordInfo> rawSuggestions,
final boolean typedWordValid,
final boolean willAutoCorrect,
final boolean isObsoleteSuggestions,
final int inputStyle,
final int sequenceNumber) {
this(suggestedWordInfoList, rawSuggestions, this(suggestedWordInfoList, rawSuggestions,
(suggestedWordInfoList.isEmpty() || isPrediction(inputStyle)) ? null (suggestedWordInfoList.isEmpty() || isPrediction(inputStyle)) ? null
: suggestedWordInfoList.get(INDEX_OF_TYPED_WORD).mWord, : suggestedWordInfoList.get(INDEX_OF_TYPED_WORD).mWord,
typedWordValid, willAutoCorrect, isObsoleteSuggestions, inputStyle, sequenceNumber); typedWordValid, willAutoCorrect,
isObsoleteSuggestions, inputStyle, NOT_A_SEQUENCE_NUMBER);
} }
public SuggestedWords(final ArrayList<SuggestedWordInfo> suggestedWordInfoList, public SuggestedWords(final ArrayList<SuggestedWordInfo> suggestedWordInfoList,