summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author jorgegil@google.com <jorgegil@google.com> 2022-05-25 14:46:19 -0700
committer jorgegil@google.com <jorgegil@google.com> 2022-05-25 15:15:00 -0700
commit8a35943e5f1526539feed260f4dfbf7b67f8d35f (patch)
tree8567bca3c5923e0232321cf8178bb290d19ff085
parent591aa05f608adb799a630e9563de61f75dced7f0 (diff)
Remove lingering content overlays in onTaskVanished
onTaskVanished already attempted to do some last resort overlay cleanup, but because onExitPipFinished was called right above it, and it internally set the state=UNDEFINED, the overlay removal in onTaskVanished was always a no-op. This change changes the order of onExitPipFinished and the animator cancelling/overlay removal so that there is always an attempt to do the removal in on vanish. There should be no risk with this change that the removal is done twice since even if the overlay is removed by an animator in onAnimationEnd, the removal in onTaskVanished first checks that an animator exists and that a content overlay exists, and one or both of those should cause it to no-op if someone else removed the content overlay earlier. Bug: 230561935 Test: enter MS teams call, swipe edge to go back, verify there's no fullscreen overlay lingering. Test: atest --iteration 5 \ ActivityThreadTest#testHandlePictureInPictureRequested_overriddenToEnter \ ScreenshotTests#testScreenshotSecureLayers \ TaskStackChangedListenerTest#testTaskChangeCallBacks Change-Id: If8639ce78148c5ba1b247bb8afeee76e20863dc5
-rw-r--r--libs/WindowManager/Shell/src/com/android/wm/shell/pip/PipTaskOrganizer.java10
1 files changed, 6 insertions, 4 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 07f2e95dfcb1..a69d373de24c 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
@@ -795,11 +795,7 @@ public class PipTaskOrganizer implements ShellTaskOrganizer.TaskListener,
"%s: Unrecognized token: %s", TAG, token);
return;
}
- onExitPipFinished(info);
- if (Transitions.ENABLE_SHELL_TRANSITIONS) {
- mPipTransitionController.forceFinishTransition();
- }
final PipAnimationController.PipTransitionAnimator<?> animator =
mPipAnimationController.getCurrentAnimator();
if (animator != null) {
@@ -810,6 +806,12 @@ public class PipTaskOrganizer implements ShellTaskOrganizer.TaskListener,
animator.removeAllListeners();
animator.cancel();
}
+
+ onExitPipFinished(info);
+
+ if (Transitions.ENABLE_SHELL_TRANSITIONS) {
+ mPipTransitionController.forceFinishTransition();
+ }
}
@Override