diff --git a/quickstep/src/com/android/quickstep/AbsSwipeUpHandler.java b/quickstep/src/com/android/quickstep/AbsSwipeUpHandler.java index a389035dec..4e635a7643 100644 --- a/quickstep/src/com/android/quickstep/AbsSwipeUpHandler.java +++ b/quickstep/src/com/android/quickstep/AbsSwipeUpHandler.java @@ -1444,6 +1444,7 @@ public abstract class AbsSwipeUpHandler, } } + @Nullable private SwipePipToHomeAnimator createWindowAnimationToPip(HomeAnimationFactory homeAnimFactory, RemoteAnimationTargetCompat runningTaskTarget, float startProgress) { // Directly animate the app to PiP (picture-in-picture) mode @@ -1469,6 +1470,10 @@ public abstract class AbsSwipeUpHandler, runningTaskTarget.taskInfo.pictureInPictureParams, homeRotation, hotseatKeepClearArea); + if (destinationBounds == null) { + // No destination bounds returned from SystemUI, bail early. + return null; + } final Rect appBounds = new Rect(); final WindowConfiguration winConfig = taskInfo.configuration.windowConfiguration; // Adjust the appBounds for TaskBar by using the calculated window crop Rect diff --git a/quickstep/src/com/android/quickstep/SystemUiProxy.java b/quickstep/src/com/android/quickstep/SystemUiProxy.java index 944e2f985d..24d2b9bb70 100644 --- a/quickstep/src/com/android/quickstep/SystemUiProxy.java +++ b/quickstep/src/com/android/quickstep/SystemUiProxy.java @@ -45,6 +45,7 @@ import android.view.RemoteAnimationTarget; import android.view.SurfaceControl; import android.window.IOnBackInvokedCallback; +import androidx.annotation.Nullable; import androidx.annotation.WorkerThread; import com.android.internal.logging.InstanceId; @@ -481,6 +482,10 @@ public class SystemUiProxy implements ISystemUiProxy { mPipAnimationListener = listener; } + /** + * @return Destination bounds of auto-pip animation, {@code null} if the animation is not ready. + */ + @Nullable public Rect startSwipePipToHome(ComponentName componentName, ActivityInfo activityInfo, PictureInPictureParams pictureInPictureParams, int launcherRotation, Rect hotseatKeepClearArea) {