From e5f4c32ce8b37ccb72ed707b60c6270fc926f4a7 Mon Sep 17 00:00:00 2001 From: "jorgegil@google.com" Date: Fri, 21 May 2021 10:44:43 -0700 Subject: [PATCH] Remove duplicate call to update PIP bounds on PIP expand Remove the callback to update bounds in resizeAndAnimatePipUnchecked because: 1. animateResizePip already attaches a callback to update the bounds state in onAnimationEnd 2. it updates the bounds too early before finishResize() is called, which causes finishResize() to not know the pre-resize bounds needed to perform the crossfade animation Bug: 188829986 Test: enter PIP with seamless resize turned on, double-tap to expand and unexpand, crossfade animation looks right Change-Id: Id64222fe762b4db0d9ea739db434e8e6acb0b31a --- .../com/android/wm/shell/pip/phone/PhonePipMenuController.java | 1 + .../src/com/android/wm/shell/pip/phone/PipMotionHelper.java | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/pip/phone/PhonePipMenuController.java b/libs/WindowManager/Shell/src/com/android/wm/shell/pip/phone/PhonePipMenuController.java index 02451c30d4ef2..f6b5889dda280 100644 --- a/libs/WindowManager/Shell/src/com/android/wm/shell/pip/phone/PhonePipMenuController.java +++ b/libs/WindowManager/Shell/src/com/android/wm/shell/pip/phone/PhonePipMenuController.java @@ -202,6 +202,7 @@ public class PhonePipMenuController implements PipMenuController { mSystemWindows.updateViewLayout(mPipMenuView, getPipMenuLayoutParams(MENU_WINDOW_TITLE, destinationBounds.width(), destinationBounds.height())); + updateMenuLayout(destinationBounds); } /** diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/pip/phone/PipMotionHelper.java b/libs/WindowManager/Shell/src/com/android/wm/shell/pip/phone/PipMotionHelper.java index 604ebc08f42ee..c42750d62dd4b 100644 --- a/libs/WindowManager/Shell/src/com/android/wm/shell/pip/phone/PipMotionHelper.java +++ b/libs/WindowManager/Shell/src/com/android/wm/shell/pip/phone/PipMotionHelper.java @@ -684,7 +684,7 @@ public class PipMotionHelper implements PipAppOpsListener.Callback, // Intentionally resize here even if the current bounds match the destination bounds. // This is so all the proper callbacks are performed. mPipTaskOrganizer.scheduleAnimateResizePip(toBounds, duration, - TRANSITION_DIRECTION_EXPAND_OR_UNEXPAND, mUpdateBoundsCallback); + TRANSITION_DIRECTION_EXPAND_OR_UNEXPAND, null /* updateBoundsCallback */); setAnimatingToBounds(toBounds); }