Modify deferred recents animation cancel to work without screenshot

- Allow the recents animation runner to request deferring a cancel from
  stack order change until the next app transition start without using
  a screenshot. This allows launcher to set this state, then start an
  activity without a flash due to the animation not finishing immediately
- Always prepare a transition when using the deferred cancel to ensure
  an app transition callback
- Handle app transition canceled as well (if canceled, we continue to
  cancel recents the animation with/without the screenshot as requested)
- Remove internal lock and use the global WM lock when setting the defer
  cancel state
- Renamed a few methods to clarify the deferred cancel flow

Bug: 137196872
Test: atest FrameworksServicesTests:RecentsAnimationControllerTest
Test: atest WmTests:RecentsAnimationTest
Change-Id: Ie8f6f60b6bf6777e36f24749b30f90c8c26ee848
diff --git a/services/core/java/com/android/server/wm/AppWindowToken.java b/services/core/java/com/android/server/wm/AppWindowToken.java
index eab5e0d..6c577e1 100644
--- a/services/core/java/com/android/server/wm/AppWindowToken.java
+++ b/services/core/java/com/android/server/wm/AppWindowToken.java
@@ -2477,7 +2477,7 @@
         // transformed the task.
         final RecentsAnimationController controller = mWmService.getRecentsAnimationController();
         if (controller != null && controller.isAnimatingTask(getTask())
-                && controller.shouldCancelWithDeferredScreenshot()) {
+                && controller.shouldDeferCancelUntilNextTransition()) {
             return false;
         }