From 252f5173b7f82bba52a6d6345ef1820bfed48092 Mon Sep 17 00:00:00 2001 From: Hongwei Wang Date: Thu, 20 Aug 2020 14:16:19 -0700 Subject: Do not trigger move animation during PiP transition When PiP is transiting to fullscreen mode, we set the activity windowing mode to fullscreen at the beginning and keep the task windowing mode in pinned mode. The hasMovementAnimation assertion should take that into account. Bug: 164101597 Bug: 159679271 Bug: 164321517 Video: http://rcll/aaaaaabFQoRHlzixHdtY/blXkl5mJF9lDto9RtnYcV2 Test: See video Change-Id: I4d887d8d2f0deab3405fd3dd38b01c3649bb51df --- services/core/java/com/android/server/wm/WindowState.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/services/core/java/com/android/server/wm/WindowState.java b/services/core/java/com/android/server/wm/WindowState.java index 11db705f4e04..b53627e6629a 100644 --- a/services/core/java/com/android/server/wm/WindowState.java +++ b/services/core/java/com/android/server/wm/WindowState.java @@ -2051,10 +2051,17 @@ class WindowState extends WindowContainer implements WindowManagerP // animating... let's do something. final int left = mWindowFrames.mFrame.left; final int top = mWindowFrames.mFrame.top; + + // During the transition from pip to fullscreen, the activity windowing mode is set to + // fullscreen at the beginning while the task is kept in pinned mode. Skip the move + // animation in such case since the transition is handled in SysUI. + final boolean hasMovementAnimation = getTask() == null + ? getWindowConfiguration().hasMovementAnimations() + : getTask().getWindowConfiguration().hasMovementAnimations(); if (mToken.okToAnimate() && (mAttrs.privateFlags & PRIVATE_FLAG_NO_MOVE_ANIMATION) == 0 && !isDragResizing() - && getWindowConfiguration().hasMovementAnimations() + && hasMovementAnimation && !mWinAnimator.mLastHidden && !mSeamlesslyRotated) { startMoveAnimation(left, top); -- cgit v1.2.3-59-g8ed1b