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

Fix Stay on 'SELECT INPUT METHOD' page after choosing input method

CL[1] aims to fix a potential ANR issue happen when the IME focused app
popup IME picker dialog and then switching another task through
status bar settings button or notifications, system will filter the IME
selection dialog window to not be the focused window when finding the next
focus during switching to the next task.

However, that filtering rule mistakes to ignore the IME picker dialog as
focus window when Gboard 'SELECT INPUT METHOD' page popup IME picker dialog
by using IMM#showInputMethodPicker (i.e. Gboard page still keeps focused),
so that after choosed input method from picker, Gboard page will not
receive onWindowFocusChanged callback to update the IME selection status,
because the page has already focused.

To fix this window focus issue of IME picker dialog and CL[1] issue scenerio
, use WindowState#isAnimating() to check if the app window with IME
picker dialog is under app transitioning, if so, then we can say it's
safe to ignore IME picker focus.

[1]: Iae3dd713b1e980067d28debea4e0a03707aa7938

Bug: 195073688
Bug: 194214768
Test: atest InputMethodManagerTest#testShowInputMethodPicker
Test: atest atest DisplayContentTests#\
        testImeMenuDialogFocusWhenImeLayeringTargetChanges
Test: manual as issue steps:
      0. Current input method is not Gboard (Canary).
      1. Tap Gboard (Canary) icon on App list.
      2. Tap 'SELECT INPUT METHOD' icon and select Gboard (Canary).
      3. Verify the IME status should updated after dismissed IME picker
         dialog.
Change-Id: I771d9817cd6dfcb1bf0d576d94bea9d1b9adc80e
parent e25f7942
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