From ee4d9ed3ad0df0ebcf0ad8befff6829e19dc2c81 Mon Sep 17 00:00:00 2001 From: Ikram Gabiyev Date: Wed, 4 Dec 2024 15:02:06 -0800 Subject: [PATCH] Do not send setFinishTaskTransaction if not swipe In PiP2, there is no need to send setFinishTaskTransaction() unless we are swiping PiP to home. This is because either ATMS#enterPictureInPictureMode() is supposed to request a TRANSIT_PIP as the activity goes to pause. Bug: 380515865 Flag: com.android.wm.shell.enable_pip2 Test: repro the steps in the bug Change-Id: Ic24c0c0f471179198a5fe3221971cf5b6d634797 --- quickstep/src/com/android/quickstep/views/RecentsView.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/quickstep/src/com/android/quickstep/views/RecentsView.java b/quickstep/src/com/android/quickstep/views/RecentsView.java index 6fc33dc08a..e3e2aaa885 100644 --- a/quickstep/src/com/android/quickstep/views/RecentsView.java +++ b/quickstep/src/com/android/quickstep/views/RecentsView.java @@ -5906,8 +5906,9 @@ public abstract class RecentsView< } final boolean sendUserLeaveHint = toRecents && shouldPip; - if (sendUserLeaveHint) { + if (sendUserLeaveHint && !com.android.wm.shell.Flags.enablePip2()) { // Notify the SysUI to use fade-in animation when entering PiP from live tile. + // Note: PiP2 handles entering differently, so skip if enable_pip2=true. final SystemUiProxy systemUiProxy = SystemUiProxy.INSTANCE.get(getContext()); systemUiProxy.setPipAnimationTypeToAlpha(); systemUiProxy.setShelfHeight(true, mContainer.getDeviceProfile().hotseatBarSizePx);