ThreadedInputConnection is wired up (in ime_adapter_android.cc) to parse BackgroundSpans and UnderlineSpans from text only when it's passed in through setComposingText(). We need to add support for SuggestionSpans for the Android voice IME, which uses commitText(), so the span parsing code needs to be consolidated.
Documentation for commitText():
"This behaves like calling setComposingText(text, newCursorPosition) then finishComposingText()."
https://developer.android.com/reference/android/view/inputmethod/InputConnection.html#commitText(java.lang.CharSequence, int)
Comment 1 by aelias@chromium.org
, Dec 12 2016Summary: commitText() doesn't parse Android spans (was: Asymmetry between setComposingText() and commitText() on ThreadedInputConnection)