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
Loading
Please register or sign in to comment