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

Skip to content
Commit f6f34944 authored by lumark's avatar lumark
Browse files

Fix recent task screenshot may not cleanup in some cases

In previous implementation, TaskScreenshotAnimatable's surface
relies on SurfaceAnimator#onAnimationLeashDestroyed callback.

As the definition of this callback method is called when leash is being
destroyed, and the surface was reparented back to the original parent,
which may not be reliable for recent task screenshot use case because task
screenhot surface may fail to reparent back if the parent is null, and
the onAnimationLeashDestroyed callback won't be called.

To fix this, we modify the reparent check to exclude parent surface check.
This is because the screenshot animatable was returning null in
Animatable.getParentSurface(), but we still need to invoke
onAnimationLeashDestroyed.

We also rename the callback to onAnimationLeashLost as it will also be called
when the animation is transferred away to another animation, even though the
leash didn't get destroyed.

Also, modified TaskScreenshotAnimatable#getParentSurfaceControl to
align Task's surface for surface hierachy correctness.

Fix: 130606600
Test: atest RecentsAnimationControllerTest
Test: atest SurfaceAnimatorTest

Change-Id: I918554befe3982a3dc0a9949c6973042697bb24b
parent ccc7759b
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