diff options
Diffstat (limited to 'libs')
| -rw-r--r-- | libs/WindowManager/Shell/src/com/android/wm/shell/pip/PipTransition.java | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/pip/PipTransition.java b/libs/WindowManager/Shell/src/com/android/wm/shell/pip/PipTransition.java index d5fab441cd46..fe4980a9eb16 100644 --- a/libs/WindowManager/Shell/src/com/android/wm/shell/pip/PipTransition.java +++ b/libs/WindowManager/Shell/src/com/android/wm/shell/pip/PipTransition.java @@ -554,6 +554,11 @@ public class PipTransition extends PipTransitionController { } } } + // if overlay is present remove it immediately, as exit transition came before it faded out + if (mPipOrganizer.mSwipePipToHomeOverlay != null) { + startTransaction.remove(mPipOrganizer.mSwipePipToHomeOverlay); + clearSwipePipToHomeOverlay(); + } if (pipChange == null) { ProtoLog.w(ShellProtoLogGroup.WM_SHELL_PICTURE_IN_PICTURE, "%s: No window of exiting PIP is found. Can't play expand animation", TAG); @@ -1007,7 +1012,6 @@ public class PipTransition extends PipTransitionController { // the overlay to the final PIP task. startTransaction.reparent(swipePipToHomeOverlay, leash) .setLayer(swipePipToHomeOverlay, Integer.MAX_VALUE); - mPipOrganizer.mSwipePipToHomeOverlay = null; } final Rect sourceBounds = pipTaskInfo.configuration.windowConfiguration.getBounds(); @@ -1029,7 +1033,7 @@ public class PipTransition extends PipTransitionController { sendOnPipTransitionFinished(TRANSITION_DIRECTION_TO_PIP); if (swipePipToHomeOverlay != null) { mPipOrganizer.fadeOutAndRemoveOverlay(swipePipToHomeOverlay, - null /* callback */, false /* withStartDelay */); + this::clearSwipePipToHomeOverlay /* callback */, false /* withStartDelay */); } mPipTransitionState.setInSwipePipToHomeTransition(false); } @@ -1173,6 +1177,10 @@ public class PipTransition extends PipTransitionController { mPipMenuController.updateMenuBounds(destinationBounds); } + private void clearSwipePipToHomeOverlay() { + mPipOrganizer.mSwipePipToHomeOverlay = null; + } + @Override public void dump(PrintWriter pw, String prefix) { final String innerPrefix = prefix + " "; |