summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Hongwei Wang <hwwang@google.com> 2021-10-29 14:11:32 -0700
committer Hongwei Wang <hwwang@google.com> 2021-10-29 14:24:40 -0700
commit5c80561b44179225109c0c723d4915def779bcab (patch)
treea1492610a5585ad32bbc184db77c7db1c6425649
parentb223ed581c4ecb51e4ad51416f8f5bb1a6048ebe (diff)
Avoid conflict surface reset on auto-enter-pip
FullscreenUnfoldController#resetSurface happens in between RecentsAnimationController cleanup and PipTaskOrganizer#onTaskAppeared may cause flicker at the end of auto-enter-pip transition. Fix it by intentionally ignore resetSurface if the task's pinned. Bug: 203724707 Bug: 204284060 Test: repeatedly swipe to enter PiP from YT on foldables Change-Id: Ie074e8a506d2526fc081ff4d089a2acb00549286
-rw-r--r--libs/WindowManager/Shell/src/com/android/wm/shell/fullscreen/FullscreenUnfoldController.java6
1 files changed, 5 insertions, 1 deletions
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/fullscreen/FullscreenUnfoldController.java b/libs/WindowManager/Shell/src/com/android/wm/shell/fullscreen/FullscreenUnfoldController.java
index fc1b704e95ad..aa3868cfca84 100644
--- a/libs/WindowManager/Shell/src/com/android/wm/shell/fullscreen/FullscreenUnfoldController.java
+++ b/libs/WindowManager/Shell/src/com/android/wm/shell/fullscreen/FullscreenUnfoldController.java
@@ -16,6 +16,7 @@
package com.android.wm.shell.fullscreen;
+import static android.app.WindowConfiguration.WINDOWING_MODE_PINNED;
import static android.util.MathUtils.lerp;
import static android.view.Display.DEFAULT_DISPLAY;
@@ -163,7 +164,10 @@ public final class FullscreenUnfoldController implements UnfoldListener,
public void onTaskVanished(ActivityManager.RunningTaskInfo taskInfo) {
AnimationContext animationContext = mAnimationContextByTaskId.get(taskInfo.taskId);
if (animationContext != null) {
- resetSurface(animationContext);
+ // PiP task has its own cleanup path, ignore surface reset to avoid conflict.
+ if (taskInfo.getWindowingMode() != WINDOWING_MODE_PINNED) {
+ resetSurface(animationContext);
+ }
mAnimationContextByTaskId.remove(taskInfo.taskId);
}