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

Polish IME insets not provided for non-IME target in split-screen

As in CL[1] we introduced AR#mImeInsetsFrozenUntilStartInput in
InsetsPolicy#adjustVisibilityForIme to temporary freeze the IME insets
visibility with the requested IME visiblity to deliver to the client
until the next input started.

The reason is when app transitioning, the next true IME visiblity
requires the next focused app to start the input connection and
updates the IME input target to WM.

We also made CL[2] to improve the IME flicker when quick-switching
from the fullscreen app to the split-screen task. However, we are
not aware mImeInsetsFrozenUntilStartInput only unfreezes the IME
insets when the target window is input target, this breaks when in
split-screen landscape mode, the adjecent non-IME target task
will not get the latest IME insets and the app size will not be
resized by ADJECENT_RESIZE if IME was visible.

Also, during switching to split-screen task from an IME shown task in
the overview screen in landscape, mImeInsetsFrozenUntilStartInput will
set to false when AR#onResize called during reparenting to split-screen
task, that will seeing a flicker by dispatching IME visible insets to
the next client too early.

To fix those problems with

1) In ImeInsetsSourceProvider#updateClientVisiblity ensure setting
   mImeInsetsFrozenUntilStartInput as false for all
   activities when they are going to visible after the new target
   updated the IME client visiblity. In case non-IME target window
   still freezes the IME insets.

2) Remove unset mImeInsetsFrozenUntilStartInput to false logic in
   AR#onResize and AR#onParentChanged, since these logic may happen
   before the new input started to make IME insets unfrozen
   unexpectedly.
3) Remove InputTarget#unfreezeInsetsAfterStartInput since it's useless
   after 1)'s change.

[1]: Id8a56c68a06a774ef12ba444fd9a368148ea4539
[2]: I332c0e4fff62df5d7b793eda2767bb58fe85a938

Fix: 257351983
Test: atest ActivityRecordTests#\
       testImeInsetsFrozenFlag_multiWindowActivities
Change-Id: I9fe8440ea111be59bd36dea4637a486c0f9f233f
parent e09d61ca
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