am 98140faa: [IL38] Fix a wrong double call

* commit '98140faac34ad2250c38c5f651788308adbedb2d':
  [IL38] Fix a wrong double call
main
Jean Chalard 2013-12-26 03:00:05 -08:00 committed by Android Git Automerger
commit 94982318e9
1 changed files with 7 additions and 7 deletions

View File

@ -1378,14 +1378,14 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
sequenceNumber, new OnGetSuggestedWordsCallback() { sequenceNumber, new OnGetSuggestedWordsCallback() {
@Override @Override
public void onGetSuggestedWords(SuggestedWords suggestedWords) { public void onGetSuggestedWords(SuggestedWords suggestedWords) {
final int suggestionCount = suggestedWords.size(); if (suggestedWords.isEmpty()) {
if (suggestionCount <= 1) { // Previous suggestions are found in InputLogic#mSuggestedWords. Since
final String mostProbableSuggestion = (suggestionCount == 0) ? null // these are the most recent suggestions and we just recomputed new
: suggestedWords.getWord(0); // ones to update them, it means the previous ones are there.
callback.onGetSuggestedWords( callback.onGetSuggestedWords(mLatinIme.mInputLogic.mSuggestedWords);
mLatinIme.getOlderSuggestions(mostProbableSuggestion)); } else {
callback.onGetSuggestedWords(suggestedWords);
} }
callback.onGetSuggestedWords(suggestedWords);
} }
}); });
} }