Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 70dc1066 authored by vadimt's avatar vadimt
Browse files

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
parent 406895cd
Loading
Loading
Loading
Loading
+17 −0
Original line number Diff line number Diff line
@@ -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);

+9 −0
Original line number Diff line number Diff line
@@ -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;
@@ -1135,6 +1137,7 @@ public abstract class AbsSwipeUpHandler<T extends StatefulActivity<?>, Q extends
        anim.addAnimatorListener(new AnimationSuccessListener() {
            @Override
            public void onAnimationStart(Animator animation) {
                Trace.beginAsyncSection(TRANSITION_OPEN_LAUNCHER, 0);
                if (mActivity != null) {
                    removeLiveTileOverlay();
                }
@@ -1149,6 +1152,12 @@ public abstract class AbsSwipeUpHandler<T extends StatefulActivity<?>, 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);