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

Commit 98140faa authored by Jean Chalard's avatar Jean Chalard
Browse files

[IL38] Fix a wrong double call

This only gives bad results if a gesture results in only one suggestion.

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