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
diff --git a/services/core/java/com/android/server/wm/RecentsAnimation.java b/services/core/java/com/android/server/wm/RecentsAnimation.java
index 07d3fb9..b50bfbb 100644
--- a/services/core/java/com/android/server/wm/RecentsAnimation.java
+++ b/services/core/java/com/android/server/wm/RecentsAnimation.java
@@ -331,6 +331,10 @@
         }
         final RecentsAnimationController controller =
                 mWindowManager.getRecentsAnimationController();
+        if (controller == null) {
+            return;
+        }
+
         final DisplayContent dc =
                 mService.mRootActivityContainer.getDefaultDisplay().mDisplayContent;
         dc.mBoundsAnimationController.setAnimationType(