Introduce ImeFocusController
Introduced ImeFocusController to manage
IME focus target and retrieve IME target event from ViewRootImpl.
With this CL, removed InputMethodManager focus check related methods
and replaced with below methods in ImeFocusController:
- onPreWindowFocus
- onPostWindowFocus
- onViewFocusChanged
- onViewDetachedFromWindow
- onWindowDismissed
- onProcessImeInputStage
Since all methods are guaranteed to interact within View or
ViewRootImpl with UiThread, so it also benefits that we can without any
lock protection, and ViewRootImpl will no longer depend on
InputMethodManager methods call in the end.
Also, Add mHasImeFocus in View.AttachInfo, for propogating if this view's
window is IME focused, if so, View#notifyFocusChangeToInputMethodManager
-> ImeFocusController#onViewFocusChanged will be called to
notify the focus change to corresponding IME focus controller.
Bug: 141738570
Test: atest SearchViewTest, FocusHandlingTest
Test: atest ActivityViewTest, MultiDisplayClientTests,
MultiDisplaySystemDecorationTests
Change-Id: Ib455704fe1e9d243f93190a84f230210dbceac2a
6 files changed