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

Commit a019ba79 authored by Gilles Debunne's avatar Gilles Debunne Committed by Android (Google) Code Review
Browse files

Merge "EditText notifies the IME when a suggestion is picked."

parents aa4fa2c5 b1619e56
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -8527,6 +8527,14 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener
                    String[] suggestions = suggestionInfo.suggestionSpan.getSuggestions();
                    suggestions[suggestionInfo.suggestionIndex] = originalText;

                    // Notify source IME of the suggestion pick
                    if (!TextUtils.isEmpty(
                            suggestionInfo.suggestionSpan.getNotificationTargetClassName())) {
                        InputMethodManager imm = InputMethodManager.peekInstance();
                        imm.notifySuggestionPicked(suggestionInfo.suggestionSpan, originalText,
                                suggestionInfo.suggestionIndex);
                    }

                    // Restore previous SuggestionSpans
                    final int lengthDifference = suggestion.length() - (spanEnd - spanStart);
                    for (int i = 0; i < length; i++) {