Merge "Fix EnterPipToOtherOrientation failure" into main
diff --git a/services/core/java/com/android/server/wm/ActivityTaskManagerService.java b/services/core/java/com/android/server/wm/ActivityTaskManagerService.java
index d984fb1..749e19b 100644
--- a/services/core/java/com/android/server/wm/ActivityTaskManagerService.java
+++ b/services/core/java/com/android/server/wm/ActivityTaskManagerService.java
@@ -3782,25 +3782,18 @@
                 }
                 EventLogTags.writeWmEnterPip(r.mUserId, System.identityHashCode(r),
                         r.shortComponentName, Boolean.toString(isAutoEnter));
-
-                // Ensure the ClientTransactionItems are bundled for this operation.
-                deferWindowLayout();
-                try {
-                    r.setPictureInPictureParams(params);
-                    r.mAutoEnteringPip = isAutoEnter;
-                    mRootWindowContainer.moveActivityToPinnedRootTask(r,
-                            null /* launchIntoPipHostActivity */, "enterPictureInPictureMode",
-                            transition);
-                    // Continue the pausing process after entering pip.
-                    if (r.isState(PAUSING) && r.mPauseSchedulePendingForPip) {
-                        r.getTask().schedulePauseActivity(r, false /* userLeaving */,
-                                false /* pauseImmediately */, true /* autoEnteringPip */,
-                                "auto-pip");
-                    }
-                    r.mAutoEnteringPip = false;
-                } finally {
-                    continueWindowLayout();
+                r.setPictureInPictureParams(params);
+                r.mAutoEnteringPip = isAutoEnter;
+                mRootWindowContainer.moveActivityToPinnedRootTask(r,
+                        null /* launchIntoPipHostActivity */, "enterPictureInPictureMode",
+                        transition);
+                // Continue the pausing process after entering pip.
+                if (r.isState(PAUSING) && r.mPauseSchedulePendingForPip) {
+                    r.getTask().schedulePauseActivity(r, false /* userLeaving */,
+                            false /* pauseImmediately */, true /* autoEnteringPip */,
+                            "auto-pip");
                 }
+                r.mAutoEnteringPip = false;
             }
         };