From 5a10672876d47a55983e60212581eff4819e03c3 Mon Sep 17 00:00:00 2001 From: Kazuki Takise Date: Tue, 26 Jul 2022 15:36:14 +0900 Subject: [PATCH] Use getOutWindowingMode instead of WINDOWING_MODE_UNDEFINED If the next windowing mode after a window exits PIP is different from that of the display, it must be set explicitly instead of just being reset to WINDOWING_MODE_UNDEFINED. Bug: 238964721 Test: Manually test PIP on YouTube Change-Id: I8b70d0032c197a3258695c73e3c3c3f7ed5115ea --- .../Shell/src/com/android/wm/shell/pip/PipTaskOrganizer.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/pip/PipTaskOrganizer.java b/libs/WindowManager/Shell/src/com/android/wm/shell/pip/PipTaskOrganizer.java index da88c2de6c01d..b3de18308c1f3 100644 --- a/libs/WindowManager/Shell/src/com/android/wm/shell/pip/PipTaskOrganizer.java +++ b/libs/WindowManager/Shell/src/com/android/wm/shell/pip/PipTaskOrganizer.java @@ -444,7 +444,7 @@ public class PipTaskOrganizer implements ShellTaskOrganizer.TaskListener, // When exit to fullscreen with Shell transition enabled, we update the Task windowing // mode directly so that it can also trigger display rotation and visibility update in // the same transition if there will be any. - wct.setWindowingMode(mToken, WINDOWING_MODE_UNDEFINED); + wct.setWindowingMode(mToken, getOutPipWindowingMode()); // We can inherit the parent bounds as it is going to be fullscreen. The // destinationBounds calculated above will be incorrect if this is with rotation. wct.setBounds(mToken, null); @@ -543,7 +543,7 @@ public class PipTaskOrganizer implements ShellTaskOrganizer.TaskListener, if (Transitions.ENABLE_SHELL_TRANSITIONS) { final WindowContainerTransaction wct = new WindowContainerTransaction(); wct.setBounds(mToken, null); - wct.setWindowingMode(mToken, WINDOWING_MODE_UNDEFINED); + wct.setWindowingMode(mToken, getOutPipWindowingMode()); wct.reorder(mToken, false); mPipTransitionController.startExitTransition(TRANSIT_REMOVE_PIP, wct, null /* destinationBounds */);