From 0a6d6154b315f2297b1553124d463b2102ead4a3 Mon Sep 17 00:00:00 2001 From: Ben Lin Date: Fri, 12 Jun 2020 18:05:40 -0700 Subject: [PATCH] PiP: Animate resize even if the bounds are the same. On PiP resize animation, we have callbacks that show menu, set PiP to the correct state, etc. Even if the bounds are the same (which is possible if the user has resized the largest possible bound and taps on it), we should still just let the animator do its job so all the post-animation callbacks are correctly executed. Bug: 158859217 Test: Resize PIP to max, wait for a new video to come in (current video finishes playing), tap on PIP - menu displays Change-Id: I37e669918434b9cfa1cd24356170ddb760092b00 --- .../com/android/systemui/pip/phone/PipMotionHelper.java | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/packages/SystemUI/src/com/android/systemui/pip/phone/PipMotionHelper.java b/packages/SystemUI/src/com/android/systemui/pip/phone/PipMotionHelper.java index d077666f81844..856c19290af69 100644 --- a/packages/SystemUI/src/com/android/systemui/pip/phone/PipMotionHelper.java +++ b/packages/SystemUI/src/com/android/systemui/pip/phone/PipMotionHelper.java @@ -491,10 +491,11 @@ public class PipMotionHelper implements PipAppOpsListener.Callback, Log.d(TAG, "resizeAndAnimatePipUnchecked: toBounds=" + toBounds + " duration=" + duration + " callers=\n" + Debug.getCallers(5, " ")); } - if (!toBounds.equals(mBounds)) { - mPipTaskOrganizer.scheduleAnimateResizePip(toBounds, duration, mUpdateBoundsCallback); - setAnimatingToBounds(toBounds); - } + + // 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, mUpdateBoundsCallback); + setAnimatingToBounds(toBounds); } /**