Loading
Fix: IMEs don't receive onUpdateSelection when performs insertion mode
TextView implements insertion mode by applying a new TransformationMethod. However, in TextView#setTransformation it will call TextView#setText. As a result, TextView will call InputMethodManager#invalidateInput and make the following updateSelection invalid until the InputConnection was reestablished. This CL fix the issue by avoiding calling setText in setTransformationMethod and instead, update the text layout only. This also avoid triggering TextWatchers on the TextView. Bug: 300850862 Test: mannually enable the flag and test with atest TextViewTest Change-Id: I2298e523e688d48bc86f055a371cc6688e20c77e