diff options
author | Hongwei Wang <hwwang@google.com> | 2024-01-12 12:47:55 -0800 |
---|---|---|
committer | Android Build Coastguard Worker <android-build-coastguard-worker@google.com> | 2024-01-17 19:56:22 +0000 |
commit | fdaa880fd202aeebbad44c4f95cf89b0581ac473 (patch) | |
tree | 1fcf6ee42e935c5b9234f101be3ef9806b07ea7e | |
parent | 096fa0d4510fbeef40e8cd765bbb8c0be0379aa0 (diff) | |
download | base-fdaa880fd202aeebbad44c4f95cf89b0581ac473.tar.gz |
Work around the flicker on enter PiP for foldables
This is work around for b/311084698
We use to rely on the mIsInStateChange flag to avoid resetting the
surface of PiP task, it's broken recently. The windowing mode check here
is not ideal but it should be safe to ignore any resetting from
UnfoldAnimationController for a Task that's already pinned.
Before: http://recall/-/aaaaaabFQoRHlzixHdtY/ahJ6dpKl1ajsaReCX70Wb
After: http://recall/-/aaaaaabFQoRHlzixHdtY/cc0H4jAt0KxqzFxzkfVjk7
Flag: NONE
Bug: 311084698
Test: Manually following the reproduce steps in bug
(cherry picked from https://googleplex-android-review.googlesource.com/q/commit:0e6c31448829cadffecc66aaebc2210d134d240b)
Merged-In: I5f60b2da8eaf948145ca61fb21433f5640f1feeb
Change-Id: I5f60b2da8eaf948145ca61fb21433f5640f1feeb
-rw-r--r-- | libs/WindowManager/Shell/src/com/android/wm/shell/unfold/UnfoldAnimationController.java | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/unfold/UnfoldAnimationController.java b/libs/WindowManager/Shell/src/com/android/wm/shell/unfold/UnfoldAnimationController.java index d7cb490ed0cb..4aed7c449750 100644 --- a/libs/WindowManager/Shell/src/com/android/wm/shell/unfold/UnfoldAnimationController.java +++ b/libs/WindowManager/Shell/src/com/android/wm/shell/unfold/UnfoldAnimationController.java @@ -16,6 +16,8 @@ package com.android.wm.shell.unfold; +import static android.app.WindowConfiguration.WINDOWING_MODE_PINNED; + import android.annotation.NonNull; import android.app.ActivityManager.RunningTaskInfo; import android.app.TaskInfo; @@ -28,11 +30,11 @@ import com.android.wm.shell.sysui.ShellInit; import com.android.wm.shell.unfold.ShellUnfoldProgressProvider.UnfoldListener; import com.android.wm.shell.unfold.animation.UnfoldTaskAnimator; +import dagger.Lazy; + import java.util.List; import java.util.Optional; -import dagger.Lazy; - /** * Manages fold/unfold animations of tasks on foldable devices. * When folding or unfolding a foldable device we play animations that @@ -228,7 +230,8 @@ public class UnfoldAnimationController implements UnfoldListener { } private void maybeResetTask(UnfoldTaskAnimator animator, TaskInfo taskInfo) { - if (!mIsInStageChange) { + // TODO(b/311084698): the windowing mode check is added here as a work around. + if (!mIsInStageChange || taskInfo.getWindowingMode() == WINDOWING_MODE_PINNED) { // No need to resetTask if there is no ongoing state change. return; } |