diff --git a/quickstep/src/com/android/launcher3/QuickstepAppTransitionManagerImpl.java b/quickstep/src/com/android/launcher3/QuickstepAppTransitionManagerImpl.java index f3d543405d..e2449a4d8a 100644 --- a/quickstep/src/com/android/launcher3/QuickstepAppTransitionManagerImpl.java +++ b/quickstep/src/com/android/launcher3/QuickstepAppTransitionManagerImpl.java @@ -57,6 +57,7 @@ import android.graphics.drawable.Drawable; import android.os.CancellationSignal; import android.os.Handler; import android.os.Looper; +import android.os.Trace; import android.util.Pair; import android.view.View; @@ -137,6 +138,7 @@ public abstract class QuickstepAppTransitionManagerImpl extends LauncherAppTrans // Progress = 0: All apps is fully pulled up, Progress = 1: All apps is fully pulled down. public static final float ALL_APPS_PROGRESS_OFF_SCREEN = 1.3059858f; + public static final String TRANSITION_OPEN_LAUNCHER = "transition:OpenLauncher"; protected final BaseQuickstepLauncher mLauncher; @@ -853,6 +855,21 @@ public abstract class QuickstepAppTransitionManagerImpl extends LauncherAppTrans // is initialized. if (launcherIsATargetWithMode(appTargets, MODE_OPENING) || mLauncher.isForceInvisible()) { + if (Trace.isEnabled()) { + anim.addListener(new AnimatorListenerAdapter() { + @Override + public void onAnimationStart(Animator animation) { + Trace.beginAsyncSection(TRANSITION_OPEN_LAUNCHER, 0); + super.onAnimationStart(animation); + } + + @Override + public void onAnimationEnd(Animator animation) { + super.onAnimationEnd(animation); + Trace.endAsyncSection(TRANSITION_OPEN_LAUNCHER, 0); + } + }); + } // Only register the content animation for cancellation when state changes mLauncher.getStateManager().setCurrentAnimation(anim); diff --git a/quickstep/src/com/android/quickstep/AbsSwipeUpHandler.java b/quickstep/src/com/android/quickstep/AbsSwipeUpHandler.java index 4bdc59e0c2..26ad3778a7 100644 --- a/quickstep/src/com/android/quickstep/AbsSwipeUpHandler.java +++ b/quickstep/src/com/android/quickstep/AbsSwipeUpHandler.java @@ -19,6 +19,7 @@ import static android.widget.Toast.LENGTH_SHORT; import static com.android.launcher3.BaseActivity.INVISIBLE_BY_STATE_HANDLER; import static com.android.launcher3.BaseActivity.STATE_HANDLER_INVISIBILITY_FLAGS; +import static com.android.launcher3.QuickstepAppTransitionManagerImpl.TRANSITION_OPEN_LAUNCHER; import static com.android.launcher3.anim.Interpolators.DEACCEL; import static com.android.launcher3.anim.Interpolators.OVERSHOOT_1_2; import static com.android.launcher3.config.FeatureFlags.ENABLE_QUICKSTEP_LIVE_TILE; @@ -53,6 +54,7 @@ import android.graphics.PointF; import android.graphics.Rect; import android.os.Build; import android.os.SystemClock; +import android.os.Trace; import android.util.Log; import android.view.MotionEvent; import android.view.View; @@ -1142,6 +1144,7 @@ public abstract class AbsSwipeUpHandler, Q extends anim.addAnimatorListener(new AnimationSuccessListener() { @Override public void onAnimationStart(Animator animation) { + Trace.beginAsyncSection(TRANSITION_OPEN_LAUNCHER, 0); if (mActivity != null) { removeLiveTileOverlay(); } @@ -1156,6 +1159,12 @@ public abstract class AbsSwipeUpHandler, Q extends maybeUpdateRecentsAttachedState(false); mActivityInterface.onSwipeUpToHomeComplete(mDeviceState); } + + @Override + public void onAnimationEnd(Animator animation) { + super.onAnimationEnd(animation); + Trace.endAsyncSection(TRANSITION_OPEN_LAUNCHER, 0); + } }); if (mRecentsAnimationTargets != null) { mRecentsAnimationTargets.addReleaseCheck(anim);