diff options
| author | 2022-11-03 13:59:17 +0000 | |
|---|---|---|
| committer | 2022-11-08 12:15:24 +0000 | |
| commit | 9130150f17bfaab6ed778b11a91e4be3fe9fefe2 (patch) | |
| tree | d5e9ee77354d0ebe9aa7a0d85b5f977f732f3bb3 /libs/androidfw/ResourceTimer.cpp | |
| parent | 46afac613a52ae4edb2b3d9c7968104c14aec943 (diff) | |
Freezing IME insets when screen turned-off
An animation flicker case happens when power off/on then unlocking the
device to show an IME activity, sometimes will seeing the app
layout jumps up-and-down after dismissing the snapshot starting window.
The root cause is when turning off the screen, IME window will be hidden
because of keyguard policy change. Then ImeInsetsProvider will
receive onPostLayout to update the insets server frame as invisible and
deliver this invisible insets change to the control target.
Also, showing IME and updating IME insets visibility requires to take
time until the IME starts the input after resuming the IME activity.
As a result, fix this flicker issue with
- Add ImeInsetsSourceProvider#setFrozen(boolean) to freeze the IME state
when turning off the screen (And unfreeze when the IME is going to
visible after unlocking the screen).
- Override setServerVisible for ImeInsetsSourceProvider to freeze server
visiblity when setFrozen(true) gets called.
Bug: 246402296
Test: atest CtsInputMethodTestCases
Test: atest WindowContainerTests ActivityRecordTests
Test: atest ImeInsetsSourceProviderTest
Test: manual with the issue steps:
1) Launch a chat app
2) Start a chat channel to show IME
3) Press power button to turn the screen off
4) Press power button to turn the screen on and unlock
5) Expect the chat activity looks fine without flickers
Change-Id: Icfec9a491681406a382c74b690d8ef303848b32e
Diffstat (limited to 'libs/androidfw/ResourceTimer.cpp')
0 files changed, 0 insertions, 0 deletions