Use IMM#invalidateInput() in EditText#setText()

With this CL, EditText#setText() actually starts using

  InputMethodManger#invalidateInput(),

which does not block the UI thread.

See the previous CL [1] about how that API actually works.

There should be no observable changes from the viewpoing of IMEs.

 [1]: I3161755779080f98bcef0e47dd0c5247d8a3a256

Bug: 203086369
Test: atest CtsInputMethodTestCases:EditTextImeSupportTest
Change-Id: I8d2e0be22454b106ded15c78c876b55dc6e60a13
This commit is contained in:
Yohei Yukawa
2021-11-17 15:22:34 -08:00
parent daa6695c2e
commit 01732bb37a

View File

@@ -1848,7 +1848,7 @@ public class Editor {
if (mHasPendingRestartInputForSetText) {
final InputMethodManager imm = getInputMethodManager();
if (imm != null) {
imm.restartInput(mTextView);
imm.invalidateInput(mTextView);
}
mHasPendingRestartInputForSetText = false;
}