Fix issue with swipe up canceling recents animation.

- Only cancel the animation if handling the button, in that case,
  FLAG_CANCELED is not set (we were previously also only falling into this
  block to cancel the animatino in KeyButtonView)

Bug: 78660363
Test: Swipe up over back button, ensure we still enter quickstep
Change-Id: I038adcbd6c4b4ffda28dd86151c855eed04f5e0d
diff --git a/services/core/java/com/android/server/policy/PhoneWindowManager.java b/services/core/java/com/android/server/policy/PhoneWindowManager.java
index bd4210c..1d5b1a3 100644
--- a/services/core/java/com/android/server/policy/PhoneWindowManager.java
+++ b/services/core/java/com/android/server/policy/PhoneWindowManager.java
@@ -6094,7 +6094,7 @@
         // Cancel any pending remote recents animations before handling the button itself. In the
         // case where we are going home and the recents animation has already started, just cancel
         // the recents animation, leaving the home stack in place for the pending start activity
-        if (isNavBarVirtKey && !down) {
+        if (isNavBarVirtKey && !down && !canceled) {
             boolean isHomeKey = keyCode == KeyEvent.KEYCODE_HOME;
             mActivityManagerInternal.cancelRecentsAnimation(!isHomeKey);
         }