From a76c0f92f457b43f678be2123b274da94e6cf43c Mon Sep 17 00:00:00 2001 From: Hongwei Wang Date: Thu, 12 May 2022 13:01:51 -0700 Subject: [PATCH] Do not offset PiP when auto-enter-pip is ongoing This is fix the problem when - Swiping an auto-enter-pip enabled Activity to home AND - Launcher activity gets destroyed and finishes the recents animation then - WMShell nevers gets onTaskAppeared for PiP since the Activity actually does not enter PiP - However, WMShell does receive shelf height change in response to the re-creation of Launcher activity - Therefore, WMShell tries to animating a blank leash using the default setup (like, default aspect ratio) and it's visible since we set the shadow radius on it Fix this in WMShell by not allowing offset PiP while auto-enter-pip animation is ongoing. Bug: 232184236 Test: follow the reproduce step in bug Change-Id: Idef3806c9e34813b39127d270138501d441c0884 --- .../Shell/src/com/android/wm/shell/pip/PipTaskOrganizer.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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 45c9a958a42a5..07f2e95dfcb12 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 @@ -1292,7 +1292,8 @@ public class PipTaskOrganizer implements ShellTaskOrganizer.TaskListener, */ public void scheduleOffsetPip(Rect originalBounds, int offset, int duration, Consumer updateBoundsCallback) { - if (mPipTransitionState.shouldBlockResizeRequest()) { + if (mPipTransitionState.shouldBlockResizeRequest() + || mPipTransitionState.getInSwipePipToHomeTransition()) { return; } if (mWaitForFixedRotation) {