diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/pip/phone/PipController.java b/libs/WindowManager/Shell/src/com/android/wm/shell/pip/phone/PipController.java index 7ac06538efa68..36589e9a367c1 100644 --- a/libs/WindowManager/Shell/src/com/android/wm/shell/pip/phone/PipController.java +++ b/libs/WindowManager/Shell/src/com/android/wm/shell/pip/phone/PipController.java @@ -450,7 +450,7 @@ public class PipController implements PipTransitionController.PipTransitionCallb null /* windowContainerTransaction */); }; - if (saveRestoreSnapFraction) { + if (mPipTaskOrganizer.isInPip() && saveRestoreSnapFraction) { // Calculate the snap fraction of the current stack along the old movement bounds final PipSnapAlgorithm pipSnapAlgorithm = mPipBoundsAlgorithm.getSnapAlgorithm(); final Rect postChangeStackBounds = new Rect(mPipBoundsState.getBounds());