Merge "No auto-pip animation if SysUI is not available" into tm-qpr-dev am: 93f650d3e0

Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Launcher3/+/19969480

Change-Id: Id300bb64efa51ca5956fea8bac36b653b732d1c2
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
Hongwei Wang
2022-09-16 20:08:46 +00:00
committed by Automerger Merge Worker
2 changed files with 10 additions and 0 deletions
@@ -1444,6 +1444,7 @@ public abstract class AbsSwipeUpHandler<T extends StatefulActivity<S>,
}
}
@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<T extends StatefulActivity<S>,
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
@@ -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) {