Annotating open-Launcher transition in trace files

Currently, in trace files, it's hard
to find the exact set of frames for this transition.

Change-Id: I17ac201f9f9bc357ba42003776ec7a20ddef033d
This commit is contained in:
vadimt committed 2020-09-08 14:51:43 -07:00
1 parent 406895cd73
commit 70dc1066b6
2 files changed
+26

No files matched your search

@@ -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);