From 411c1b4856bebf06d770a06e4c4e4801373e4eae Mon Sep 17 00:00:00 2001 From: Chris Li Date: Wed, 2 Mar 2022 22:51:27 +0800 Subject: [PATCH] Transfer PipContentOverlay when swipe to home with Shell transition Update launcher to pass the taskId to Shell, so that Shell can reparent the overlay from the remote transition leash to the Task leash. Otherwise the overlay will be removed with the transition leash when transition is finished. Bug: 222030101 Test: verify with swipe to home with Shell transition Change-Id: I838c22951fdf79c3213f2c9b1cb73a4a90341597 --- .../src/com/android/quickstep/AbsSwipeUpHandler.java | 1 + quickstep/src/com/android/quickstep/SystemUiProxy.java | 9 +++++++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/quickstep/src/com/android/quickstep/AbsSwipeUpHandler.java b/quickstep/src/com/android/quickstep/AbsSwipeUpHandler.java index 2cb7100378..95f659b787 100644 --- a/quickstep/src/com/android/quickstep/AbsSwipeUpHandler.java +++ b/quickstep/src/com/android/quickstep/AbsSwipeUpHandler.java @@ -1760,6 +1760,7 @@ public abstract class AbsSwipeUpHandler, private void maybeFinishSwipeToHome() { if (mIsSwipingPipToHome && mSwipePipToHomeAnimators[0] != null) { SystemUiProxy.INSTANCE.get(mContext).stopSwipePipToHome( + mSwipePipToHomeAnimator.getTaskId(), mSwipePipToHomeAnimator.getComponentName(), mSwipePipToHomeAnimator.getDestinationBounds(), mSwipePipToHomeAnimator.getContentOverlay()); diff --git a/quickstep/src/com/android/quickstep/SystemUiProxy.java b/quickstep/src/com/android/quickstep/SystemUiProxy.java index 8b00f45426..3441b2cf64 100644 --- a/quickstep/src/com/android/quickstep/SystemUiProxy.java +++ b/quickstep/src/com/android/quickstep/SystemUiProxy.java @@ -541,11 +541,16 @@ public class SystemUiProxy implements ISystemUiProxy, return null; } - public void stopSwipePipToHome(ComponentName componentName, Rect destinationBounds, + /** + * Notifies WM Shell that launcher has finished all the animation for swipe to home. WM Shell + * can choose to fade out the overlay when entering PIP is finished, and WM Shell should be + * responsible for cleaning up the overlay. + */ + public void stopSwipePipToHome(int taskId, ComponentName componentName, Rect destinationBounds, SurfaceControl overlay) { if (mPip != null) { try { - mPip.stopSwipePipToHome(componentName, destinationBounds, overlay); + mPip.stopSwipePipToHome(taskId, componentName, destinationBounds, overlay); } catch (RemoteException e) { Log.w(TAG, "Failed call stopSwipePipToHome"); }