Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

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

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
parent 3d8c880d
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