Annotating open-app transitions in trace files

Change-Id: I2461186321b7c33dbabca34c066b61f2169010f3
This commit is contained in:
vadimt
2020-09-08 15:36:07 -07:00
parent 57cf650115
commit f367ced932

View File

@@ -904,6 +904,9 @@ public abstract class QuickstepAppTransitionManagerImpl extends LauncherAppTrans
*/
private class AppLaunchAnimationRunner implements WrappedAnimationRunnerImpl {
private static final String TRANSITION_LAUNCH_FROM_RECENTS = "transition:LaunchFromRecents";
private static final String TRANSITION_LAUNCH_FROM_ICON = "transition:LaunchFromIcon";
private final Handler mHandler;
private final View mV;
@@ -926,7 +929,8 @@ public abstract class QuickstepAppTransitionManagerImpl extends LauncherAppTrans
boolean launcherClosing =
launcherIsATargetWithMode(appTargets, MODE_CLOSING);
if (isLaunchingFromRecents(mV, appTargets)) {
final boolean launchingFromRecents = isLaunchingFromRecents(mV, appTargets);
if (launchingFromRecents) {
composeRecentsLaunchAnimator(anim, mV, appTargets, wallpaperTargets,
launcherClosing);
} else {
@@ -934,6 +938,26 @@ public abstract class QuickstepAppTransitionManagerImpl extends LauncherAppTrans
launcherClosing);
}
if (Trace.isEnabled()) {
final String section =
launchingFromRecents
? TRANSITION_LAUNCH_FROM_RECENTS : TRANSITION_LAUNCH_FROM_ICON;
anim.addListener(new AnimatorListenerAdapter() {
@Override
public void onAnimationStart(Animator animation) {
Trace.beginAsyncSection(section, 0);
super.onAnimationStart(animation);
}
@Override
public void onAnimationEnd(Animator animation) {
super.onAnimationEnd(animation);
Trace.endAsyncSection(section, 0);
}
});
}
if (launcherClosing) {
anim.addListener(mForceInvisibleListener);
}