From b23cdf1f93ee3902d6fa4864a32d253c2c31576e Mon Sep 17 00:00:00 2001 From: Vinit Nayak Date: Fri, 18 Aug 2023 00:36:41 +0000 Subject: [PATCH] Pass extras Bundle in onRecentsAnimationStart * Bundle will contain SplitBounds if recents animation contains splitscreen targets * Key to use is SplitBounds#KEY_RECENTS_BUNDLE Test: Swiping up with single + split tasks Bug: 254378592 Change-Id: I51f4063aa62ae22a43ffb3712ae6a837156f32d8 --- .../com/android/quickstep/RecentsAnimationCallbacks.java | 7 ++++--- quickstep/src/com/android/quickstep/SystemUiProxy.java | 9 +++++++-- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/quickstep/src/com/android/quickstep/RecentsAnimationCallbacks.java b/quickstep/src/com/android/quickstep/RecentsAnimationCallbacks.java index 2256cbf14b..d300cc57c2 100644 --- a/quickstep/src/com/android/quickstep/RecentsAnimationCallbacks.java +++ b/quickstep/src/com/android/quickstep/RecentsAnimationCallbacks.java @@ -23,6 +23,7 @@ import static com.android.quickstep.util.ActiveGestureErrorDetector.GestureEvent import static com.android.quickstep.util.ActiveGestureErrorDetector.GestureEvent.START_RECENTS_ANIMATION; import android.graphics.Rect; +import android.os.Bundle; import android.util.ArraySet; import android.view.RemoteAnimationTarget; @@ -92,9 +93,9 @@ public class RecentsAnimationCallbacks implements @Deprecated public final void onAnimationStart(RecentsAnimationControllerCompat controller, RemoteAnimationTarget[] appTargets, Rect homeContentInsets, - Rect minimizedHomeBounds) { + Rect minimizedHomeBounds, Bundle extras) { onAnimationStart(controller, appTargets, new RemoteAnimationTarget[0], - homeContentInsets, minimizedHomeBounds); + homeContentInsets, minimizedHomeBounds, extras); } // Called only in R+ platform @@ -102,7 +103,7 @@ public class RecentsAnimationCallbacks implements public final void onAnimationStart(RecentsAnimationControllerCompat animationController, RemoteAnimationTarget[] appTargets, RemoteAnimationTarget[] wallpaperTargets, - Rect homeContentInsets, Rect minimizedHomeBounds) { + Rect homeContentInsets, Rect minimizedHomeBounds, Bundle extras) { long appCount = Arrays.stream(appTargets) .filter(app -> app.mode == MODE_CLOSING) .count(); diff --git a/quickstep/src/com/android/quickstep/SystemUiProxy.java b/quickstep/src/com/android/quickstep/SystemUiProxy.java index e73b52585f..ef2d20a592 100644 --- a/quickstep/src/com/android/quickstep/SystemUiProxy.java +++ b/quickstep/src/com/android/quickstep/SystemUiProxy.java @@ -1351,9 +1351,14 @@ public class SystemUiProxy implements ISystemUiProxy { @Override public void onAnimationStart(IRecentsAnimationController controller, RemoteAnimationTarget[] apps, RemoteAnimationTarget[] wallpapers, - Rect homeContentInsets, Rect minimizedHomeBounds) { + Rect homeContentInsets, Rect minimizedHomeBounds, Bundle extras) { + // Aidl bundles need to explicitly set class loader + // https://developer.android.com/guide/components/aidl#Bundles + if (extras != null) { + extras.setClassLoader(getClass().getClassLoader()); + } listener.onAnimationStart(new RecentsAnimationControllerCompat(controller), apps, - wallpapers, homeContentInsets, minimizedHomeBounds); + wallpapers, homeContentInsets, minimizedHomeBounds, extras); } @Override