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

Fix IME layering issue by non-focusable IME target overlay

CL[1] aims to polish the IME flicker issue happens from switching the
app task with IME shown to the new split-screen task.

The CL added a check to not change the IME parent on top of the layering
tartet if the IME layering target window hasn't requested IME.

However, there is an edge case that if the app creates a
non-focusable application overlay window that intentionaly makes IME
layering above this overlay with "NOT_FOCUSABLE | ALT_FOCUSABLE_IM" flags
which means that even the overlay isn't request the IME explicitly,
the IME still allows to reparent on top of the IME layering target.

With the CL, it breaks if an activity behind the overlay requests IME and
will not show up since the overlay has taken the layering control but without
the overlay window requests the IME, IME will not reparent on top of the
acitvity.

To fix it, we should also check if the IME layering target may actually
become the input target, if so, then hold the reparent change until
the target has started the input, if not like the overlay use case then
we can allow the IME reparent on top of it directly.

[1]: I332c0e4fff62df5d7b793eda2767bb58fe85a938

Fix: 228766370
Test: atest DisplayContentTests#testComputeImeParent_inputTargetNotUpdate
Test: atest WindowStateTests#\
   testAdjustImeInsetsVisibilityWhenSwitchingApps_toAppInMultiWindowMode
Test: atest DisplayContentTests#testComputeImeParent_inputTargetNotUpdate
Test: manual by using EditorTextVariations tool
 1) make and install EditTextVariations
 2) Enable "Settings > Display over other apps" for
    EditTextVariations
 3) Launch EditTextVariations from all apps
 4) Menu -> Show IME focuable overlay
 5) Go to home screen by gesture or pressing home key
 6) Launch any app (e.g. Chrome) and tap the editor
 7) Expect IME can show up
Test: make sure bug 210391817 won't happen

Change-Id: I97025e9466d79d3fc28b717e597a558bc90b08ff
parent ddd9dc84
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