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

Commit eb717aff authored by Jernej Virag's avatar Jernej Virag
Browse files

Enable tracing of Lottie animations

This adds markers to Perfetto traces when animations are running so we
can more easily debug them.

Bug: 420685896
Flag: EXEMPT just tracing
Test: built and ran
Change-Id: Ie7bb107643933112fc6d557c5122987a66aa7255
parent 328835e7
Loading
Loading
Loading
Loading
+7 −1
Original line number Diff line number Diff line
@@ -39,6 +39,8 @@ import android.view.View;
import androidx.annotation.NonNull;
import androidx.annotation.VisibleForTesting;

import com.airbnb.lottie.Lottie;
import com.airbnb.lottie.LottieConfig;
import com.android.internal.protolog.ProtoLog;
import com.android.systemui.dagger.GlobalRootComponent;
import com.android.systemui.dagger.SysUIComponent;
@@ -143,7 +145,11 @@ public class SystemUIApplication extends Application implements
        View.setTracedRequestLayoutClassClass(
                rootComponent.getSystemPropertiesHelper()
                        .get("persist.debug.trace_request_layout_class", null));

        // Have Lottie emit trace slices if tracing is enabled.
        Lottie.initialize(new LottieConfig.Builder()
                .setEnableSystraceMarkers(Trace.isTagEnabled(Trace.TRACE_TAG_APP))
                .setEnableNetworkCache(false)
                .build());
        if (Flags.enableLayoutTracing()) {
            View.setTraceLayoutSteps(true);
        }