Fix IME snapshot missing to remove by defered IME target computation
When swiping the app task to home, in Task#moveTaskToFront will call
deferUpdateImeTarget to defer updating IME target until the recents
animation finished, this makes the IME snapshot cannot be removed when
finished app transition or recents animation.
Moreover, if bring that app task to the top next and then a
configuration change makes the app's activity relaunch, IME snapshot
could not be removed by DC#removeImeSnapshotIfPossible because the
window's parent may still in app transitioning.
To fix this unexpected IME snapshot visibility, consolidate logc with:
1) Modify removeImeSnapshotIfPossible with
   removeImeSnapshotByTarget(windowContainer) that removing IME snapshot
   when the target window is the snapshot caller without checking
   isAnimating, in case IME snapsthot missed to remove when the
   activity main window is relaunching.
2) Calling removeImeSurfaceByTarget when
   WindowState#onSurfaceShownChanged(false), in case deferring IME
   target computation will not remove IME snapsot by missing the
   animation finished callback.
Fix: 235376671
Test: atest DisplayContentTests#\
       testRemoveImeScreenshot_whenTargetSurfaceWasInvisible
Test: atest DisplayContentTests#\
       testRemoveImeScreenshot_whenWindowRemoveImmediately
Change-Id: I937b549afaaa5bd22aa232adb1cbb2cbb1cd8e8e
Loading
Please register or sign in to comment
