Skip to content
Commit a56779d1 authored by Ming-Shin Lu's avatar Ming-Shin Lu
Browse files

Fix the logics in ImeFocusController#onPostWindowFocus

In ImeFocusController#onPostWindowFocus -> onViewFocusChanged,
it implies that the view has focus after onPostWindowFocus, this logics
we keep leveraged from IMM#onPostWindowFocus -> focusInLocked() long
ago, which may not always be true as SearchView layout may call
View#clearFocus when size changed after IME switcher shown.

When IME switched and back to app activity, in the above call path,
even activity window focused, and set the fallback focus view as
activity's root view, but the root view is not actually focused,
if we set this view as the next served view, then calling
View#onCreateInputConnection will return null, because it's not an editor.

Use correct view focus state when calling onViewFocusChanged.

Fix: 153612876
Test: manual as below:
     1) Launch Files app, taps SearchView EditText
     2) switch IMEs with IME switcher dialog
     3) see if Password keyboard shown.
     4) keeps 2) and 3) several time.
     Expected: There is no password keyboard and
     the keyboard input is still workable.
Change-Id: I68bb95fc3cbfe1f5992ccf87694b34c3e52bb31f
parent b839af1f
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