Fix IME picker dialog being dismissed by the app overlay
In CL[1] we introduced InputMethodManagerInternal#onImeParentChanged
for WM to callback the IME surface parent change event as the signal
to make the decision if the IME picker dialog should dismiss.
In mostly, the IME surface parent could happen when the IME input
target changed. However, it could also possible when the app overlay
window specified NOT_FOCUSABLE | ALT_FOCUSABLE_IM without starting
the input, so if the overlay window has changed its visibility while
taping the picker icon in the meantime, it will cause IME picker
dialog mistakenly dismissed.
Add a check in onImeParentChanged callback to only dismiss the picker
dialog when the IME surface parent is changed by the input target
changed.
[1]: Ib0813e2c12909ede4e582eb3499599e3cc253490
Fix: 236101545
Test: manual as steps:
0) install and run "Panels - SideBar" 3rd-party app
0-1) install another 3rd-party IME app (e.g. SwiftKey)
1) launch a app with showing the keyboard (e.g. Messaging app)
2) tapping the IME picker icon from navigation bar
3) selecting IME apps from the picker dialog
4) repeat step 2-3 several times, expect the picker dialog
should not be dismissed.
Test: atest InputMethodPickerTest InputMethodManagerTest
Change-Id: I56fe9735f48c92c4291700d8e2ff0111b909df80
Loading
Please register or sign in to comment