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

Update IME control target when windowConfiguration changed

The CL is approching to fix the following cases:

1. App lost the IME insets control after exited from split-screen:

When entering split-screen, by default the IME control target is the
remote insets control target which is DisplayImeController in SystemUI.

the issue happens when the app task exited from multi-window mode, the
app will no longer controls the IME insets because the target is still
be remote.

Make sure to update the IME control target when windowing mode change
in case the app lost the IME inets control.

2. Somehow IME container failed to attach to the app during rotating

As DC#updateImeParent doesn't guarantee to be called after
onConfigurationChanged, and attaching IME container to the app requires
DC#isImeAttachedToApp to be true that the app's bounds should be match
it's parent bounds,

but invoking timing might happens on the intermediate state that the
bounds may not match during rotating.

In CL[1] we used a workaround to fix this potential issue by calling
updateImeParent while rotated the device -> swiping the app task with
IME to recents.

With this CL, both IME control target and IME container parent will be
updated when the windowConfiguration chagned,

And we can probably get rid of 2)'s workaround and will remove
that workaround in CL[1] in the next CL.

[1]: Ia6722e1cbccd7adc8aed1828265f6fa4df78df63

Fix: 184809885
Bug: 184020899
Test: atest WindowStateTests#\
      testUpdateImeControlTargetWhenLeavingMultiWindow
Test: manual as below steps:
    1) make & install WindowInsetsTests app
    2) Launch shortcut > press "Window Insets Controller" button
    3) Tap editText to show IME and press "IME VISIBLE / INVISIBLE"
       button to verify if the app can control IME visibility.
    4) Go to recents app and enter split-screen mode, launch any apps on
       the bottom split.
    5) Repeat steps 3 again to see if the app still can control IME
       visibility.
Change-Id: If5accb22340335c951b37fa29eb8c308179bf645
parent 4255d362
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment