From c4cc2a52f170339b0c8fb85109d964b9b4ccfdae Mon Sep 17 00:00:00 2001 From: Merissa Mitchell Date: Mon, 5 May 2025 12:26:04 -0700 Subject: [PATCH] [Pip2] Reload Recents when IPipAnimationListener#onExitPip is triggered instead of in RecentsView#onActivityUnpinned, so that Recents is updated in sync with PiP transitions. Bug: 416075099 Test: m Test: Presubmits Flag: com.android.wm.shell.enable_pip2 Change-Id: If593c2e7271e972e96b1ab21b4396af66b1e3ea4 --- .../com/android/quickstep/views/RecentsView.java | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/quickstep/src/com/android/quickstep/views/RecentsView.java b/quickstep/src/com/android/quickstep/views/RecentsView.java index fce60aec44..9fa36bf3df 100644 --- a/quickstep/src/com/android/quickstep/views/RecentsView.java +++ b/quickstep/src/com/android/quickstep/views/RecentsView.java @@ -657,7 +657,10 @@ public abstract class RecentsView< return; } - reloadIfNeeded(); + // If PiP2 is enabled, we will trigger the reload only after the Transition is finished. + if (!PipFlags.isPip2ExperimentEnabled()) { + reloadIfNeeded(); + } enableLayoutTransitions(); } @@ -6919,6 +6922,16 @@ public abstract class RecentsView< mRecentsView.mSizeStrategy.getTaskbarController().onExpandPip(); }); } + + @Override + public void onExitPip() { + MAIN_EXECUTOR.execute(() -> { + if (mRecentsView == null || !PipFlags.isPip2ExperimentEnabled()) { + return; + } + mRecentsView.reloadIfNeeded(); + }); + } } /** Get the color used for foreground scrimming the RecentsView for sharing. */