summaryrefslogtreecommitdiff
path: root/tools/aapt2/diff/Diff.cpp
diff options
context:
space:
mode:
authorYohei Yukawa <yukawa@google.com>2021-04-27 19:20:16 -0700
committerYohei Yukawa <yukawa@google.com>2021-04-27 19:20:16 -0700
commita35ebcf88e0a9458f243df3ab4ed85e7ecccddc5 (patch)
tree63694dae30719312aee3d92d74ccf545720f777d /tools/aapt2/diff/Diff.cpp
parent3dfc4cd49805f7f1dbce2392298215fbd5e4de4b (diff)
Fix stale EditorInfo upon EditText#setText()
This is a follow up to our previous CL [1], which added initial surrounding text support into EditorInfo and let TextView support it. What we overlooked was that calling TextView#setText() would trigger TextView#onCreateInputConnection() before TextView#mText is updated to the new value. As a result, EditorInfo is initialized with a stale surrounding text information. With this CL, EditorInfo will correctly be initialized with the new text specified to TextView#setText(). One complicated thing in this CL is InputMethodManager also has some issues about how to drop spurious InputMethodService#onUpdateSelection() while InputConnection is being replaced with a new instance. I ended up having to introduce a hacky boolean Editor#mHasPendingRestartInputForSetText to work around this in the TextView/EditText. This workaround is expected to be removed/revisited as part of Bug 186582769. [1]: Ie04f2349b1157408aa8ed9044aea12ce99132cb4 c486acc4d29a0e441ddcd05b3fc0c919aee7fbd0 Fix: 161330778 Test: atest CtsInputMethodTestCases:EditTextImeSupportTest Change-Id: Iee3b754eea319861b2eb955d6cc95ba13006b55e
Diffstat (limited to 'tools/aapt2/diff/Diff.cpp')
0 files changed, 0 insertions, 0 deletions