Skip to content
Commit 970d9d2e authored by lumark's avatar lumark
Browse files

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
parent e27db5d3
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment