diff --git a/quickstep/src/com/android/quickstep/util/AppPairsController.java b/quickstep/src/com/android/quickstep/util/AppPairsController.java index ac4032c171..e1013dbe36 100644 --- a/quickstep/src/com/android/quickstep/util/AppPairsController.java +++ b/quickstep/src/com/android/quickstep/util/AppPairsController.java @@ -242,8 +242,7 @@ public class AppPairsController { WorkspaceItemInfo app2 = appPairIcon.getInfo().getSecondApp(); ComponentKey app1Key = new ComponentKey(app1.getTargetComponent(), app1.user); ComponentKey app2Key = new ComponentKey(app2.getTargetComponent(), app2.user); - mSplitSelectStateController.setLaunchingCuj(cuj); - InteractionJankMonitorWrapper.begin(appPairIcon, cuj); + mSplitSelectStateController.setLaunchingCuj(appPairIcon, cuj); mSplitSelectStateController.findLastActiveTasksAndRunCallback( Arrays.asList(app1Key, app2Key), diff --git a/quickstep/src/com/android/quickstep/util/SplitSelectStateController.java b/quickstep/src/com/android/quickstep/util/SplitSelectStateController.java index 431cfbe3f2..ae6757f17d 100644 --- a/quickstep/src/com/android/quickstep/util/SplitSelectStateController.java +++ b/quickstep/src/com/android/quickstep/util/SplitSelectStateController.java @@ -59,6 +59,7 @@ import android.os.UserHandle; import android.util.Log; import android.util.Pair; import android.view.SurfaceControl; +import android.view.View; import android.window.IRemoteTransitionFinishedCallback; import android.window.RemoteTransition; import android.window.RemoteTransitionStub; @@ -148,9 +149,10 @@ public class SplitSelectStateController { /** * Should be a constant from {@link com.android.internal.jank.Cuj} or -1, does not need to be - * set for all launches. + * set for all launches. Used in conjunction with {@link #mLaunchingViewCuj} below. */ private int mLaunchCuj = -1; + private View mLaunchingViewCuj; private FloatingTaskView mFirstFloatingTaskView; private SplitInstructionsView mSplitInstructionsView; @@ -650,7 +652,12 @@ public class SplitSelectStateController { return mSplitAnimationController; } - public void setLaunchingCuj(int launchCuj) { + /** + * Set params to invoke a trace session for the given view and CUJ when we begin animating the + * split launch AFTER we get a response from Shell. + */ + public void setLaunchingCuj(View launchingView, int launchCuj) { + mLaunchingViewCuj = launchingView; mLaunchCuj = launchCuj; } @@ -688,6 +695,9 @@ public class SplitSelectStateController { && mLaunchingTaskView.getRecentsView() != null && mLaunchingTaskView.getRecentsView().isTaskViewVisible( mLaunchingTaskView); + if (mLaunchingViewCuj != null && mLaunchCuj != -1) { + InteractionJankMonitorWrapper.begin(mLaunchingViewCuj, mLaunchCuj); + } mSplitAnimationController.playSplitLaunchAnimation( shouldLaunchFromTaskView ? mLaunchingTaskView : null, mLaunchingIconView, @@ -750,6 +760,7 @@ public class SplitSelectStateController { InteractionJankMonitorWrapper.end(mLaunchCuj); } mLaunchCuj = -1; + mLaunchingViewCuj = null; if (mSessionInstanceIds != null) { mStatsLogManager.logger()