diff options
| author | 2023-12-06 19:45:09 +0000 | |
|---|---|---|
| committer | 2023-12-06 19:45:09 +0000 | |
| commit | 0d75a206ad2931d7cc13c26fb672fd6a4b4f3edf (patch) | |
| tree | 7287a646f034996b70adf059cae984d8f7a8fa3a | |
| parent | 6557342b260cac753fa2c06b45ca535803220291 (diff) | |
| parent | df339e70a06aefed4a1dec50bc369c8db3cdee8c (diff) | |
Merge "Only remove overlay reference once it is faded out" into main
| -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 + " "; |