@@ -9607,15 +9607,6 @@ private class SuggestionInfo {
96079607 SpannableStringBuilder text = new SpannableStringBuilder ();
96089608 TextAppearanceSpan highlightSpan = new TextAppearanceSpan (mContext ,
96099609 android .R .style .TextAppearance_SuggestionHighlight );
9610-
9611- void removeMisspelledFlag () {
9612- int suggestionSpanFlags = suggestionSpan .getFlags ();
9613- if ((suggestionSpanFlags & SuggestionSpan .FLAG_MISSPELLED ) > 0 ) {
9614- suggestionSpanFlags &= ~SuggestionSpan .FLAG_MISSPELLED ;
9615- suggestionSpanFlags &= ~SuggestionSpan .FLAG_EASY_CORRECT ;
9616- suggestionSpan .setFlags (suggestionSpanFlags );
9617- }
9618- }
96199610 }
96209611
96219612 private class SuggestionAdapter extends BaseAdapter {
@@ -9931,6 +9922,14 @@ public void onItemClick(AdapterView<?> parent, View view, int position, long id)
99319922 suggestionSpansStarts [i ] = editable .getSpanStart (suggestionSpan );
99329923 suggestionSpansEnds [i ] = editable .getSpanEnd (suggestionSpan );
99339924 suggestionSpansFlags [i ] = editable .getSpanFlags (suggestionSpan );
9925+
9926+ // Remove potential misspelled flags
9927+ int suggestionSpanFlags = suggestionSpan .getFlags ();
9928+ if ((suggestionSpanFlags & SuggestionSpan .FLAG_MISSPELLED ) > 0 ) {
9929+ suggestionSpanFlags &= ~SuggestionSpan .FLAG_MISSPELLED ;
9930+ suggestionSpanFlags &= ~SuggestionSpan .FLAG_EASY_CORRECT ;
9931+ suggestionSpan .setFlags (suggestionSpanFlags );
9932+ }
99349933 }
99359934
99369935 final int suggestionStart = suggestionInfo .suggestionStart ;
@@ -9939,8 +9938,6 @@ public void onItemClick(AdapterView<?> parent, View view, int position, long id)
99399938 suggestionStart , suggestionEnd ).toString ();
99409939 editable .replace (spanStart , spanEnd , suggestion );
99419940
9942- suggestionInfo .removeMisspelledFlag ();
9943-
99449941 // Notify source IME of the suggestion pick. Do this before swaping texts.
99459942 if (!TextUtils .isEmpty (
99469943 suggestionInfo .suggestionSpan .getNotificationTargetClassName ())) {
0 commit comments