Fix IME jumpcut when playing user IME animation after IME restarted
There are 2 cases that will seeing IME jumpcut when IME insets animation
is controlled by the app during IME prcocess being killed & restarted:
1) When IME process been killed for some reasons
(e.g. force-stop package ), during IME restarting,
DC#computeImeTarget will select the remote insets target as the control
target and deliver IME leash to WM shell. If the focused window is
not in multi-windowing mode, it may have a timing that IME surface
may unexpectedly shown when starting insets animation from the remote.
2) Previously CL[1] fixed an IME surface visiblity issue when enabling
shell-transition that related to somehow IME insets source visibility
out of sync with the actual IME surface visiblity. The CL fix is
setting IME surface alpha value according to the requested visiblity in
InsetsSourceConsumer#setControl as a workaround. However, this may
cause a side-effect that after IME restarted and leash updated,
when the app requests showing IME animation, system calls setControl to
the client to set the same leash after IME onPostLayout, then
applyRequestedVisibilityToControl will be called before the
insets controller calls setInsetsAndAlpha for the animation, if the
IME requested visibility has visible, IME jumpcut will happen.
To fix this issue:
For 1), returning null control target in DC#computeImeTarget for
the above special case.
For 2), with CL[2] can fully fixed IME visiblity issue by letting the
client know the initial visibility of an InsetsSourceControl and
correctly animate insets when delivering the new leash or the
visibility change of the InsetsSourceControl. for delivering same
leash to request animation case, adding a check to call
applyRequestedVisibilityToControl only when there is no running
animation.
[1]: Iaacdf5f57e68b928e2a19036cbd8a137cf320497
[2]: I2c02e97e191ebd83238c0c54908e861d200d4c8d
Fix: 239808087
Bug: 209064170
Test: atest DisplayContentTests InsetsSourceConsumerTest
Test: manual test steps in b/239808087#comment2
Test: manual test as steps in b/209064170
0) Enabling shell-transition
1) Launching camera app
2) Swiping camera app to launcher
3) Verify status bar appear animation works
Change-Id: I242517a9214b36049d94e89d1ee63ffe505b91ac
(cherry picked from commit 8945b5bcfceb3060fd6ff954d9ce1d703cf4a093)
4 files changed