diff options
| author | 2024-05-06 15:12:00 -0700 | |
|---|---|---|
| committer | 2024-05-06 15:12:00 -0700 | |
| commit | 257ecd25674b2646712d75b37ab334cd6cee9349 (patch) | |
| tree | a7765ca3c8598c22cb3aa40ee0ccbb22f82d0aeb /libs/androidfw/StringPool.cpp | |
| parent | 0d29f42497f93df5e09d5a2180afd8226f8eefca (diff) | |
Also call IMM#checkFocus() in IMM#hideSoftInputFromView()
This is a follow up CL to our previous CLs [1][2], which introduced
@hide InputMethodManager#hideSoftInputFromView()
to convert the following boilerplate code we used to see in the
Framework code
var imm = view.getSystemService(InputMethodManager.class);
if (imm != null && imm.isActive(view)) {
imm.hideSoftInputFromWindow(view.getWindowToken(), 0);
}
into the following code.
imm.hideSoftInputFromView(view, 0);
In Bug 332912075, we however noticed that certain apps had already
relied on IMM#checkFocus(), which is internally called in isActive(),
and our CL [1] broke such apps.
To make such apps work again, this CL introduces IMM#checkFocus() into
IMM#hideSoftInputFromView() as we do so everywhere.
There could be other approaches, but how now being consistent with
other methods probably would be the best way to avoid confusions for
both app developers and futuer maintainer of InputMethodManager.java.
Hope we can come up with a better architecture in the future.
As for the minimum repro code, see the corresponding test case [3].
[1]: I01e5a29c0f82d068751774a2c58a1bd7b7b7f91a
2a757ef4aea5cf9674be508e87378f66874ef163
[2]: I7b305a93a7957ba5caebf49d55562fcf23f26766
fee50a4cdf98e53d3e9bcd8ca7d4b6a07bdcbca3
[3]: Ibc28a3b5c3ce987672f31a4125ab9204750dc530
Bug: 296466613
Fix: 332912075
Test: test CtsInputMethodTestCases:EditTextImeSupportTest#testDisableImeAfterFocusChange
Change-Id: I8dc003a38e7b95978fec83d055e44980163b70fb
Diffstat (limited to 'libs/androidfw/StringPool.cpp')
0 files changed, 0 insertions, 0 deletions