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

Commit 3b0a43b5 authored by Nicolo' Mazzucato's avatar Nicolo' Mazzucato
Browse files

Add tracing for setEdgeBackPlugin

It seems this happens at every unfold, and still takes most of the taskbar initialization time due to `setLayoutParam` when the edge back plugin is set.

This trace will make it more easily visible in traces.

Bug: 219035565
Test: Checked perfetto traces for the new sections to be visible
Change-Id: I74e793467eb37705b2647d0ea9c64bd7b5191d9e
parent 8d22a5fa
Loading
Loading
Loading
Loading
+18 −7
Original line number Diff line number Diff line
@@ -525,6 +525,15 @@ public class EdgeBackGestureHandler implements PluginListener<NavigationEdgeBack
    }

    private void updateIsEnabled() {
        try {
            Trace.beginSection("EdgeBackGestureHandler#updateIsEnabled");
            updateIsEnabledTraced();
        } finally {
            Trace.endSection();
        }
    }

    private void updateIsEnabledTraced() {
        boolean isEnabled = mIsAttached && mIsGesturalModeEnabled;
        if (isEnabled == mIsEnabled) {
            return;
@@ -611,14 +620,16 @@ public class EdgeBackGestureHandler implements PluginListener<NavigationEdgeBack
    }

    private void setEdgeBackPlugin(NavigationEdgeBackPlugin edgeBackPlugin) {
        if (mEdgeBackPlugin != null) {
            mEdgeBackPlugin.onDestroy();
        }
        try {
            Trace.beginSection("setEdgeBackPlugin");
            mEdgeBackPlugin = edgeBackPlugin;
            mEdgeBackPlugin.setBackCallback(mBackCallback);
            mEdgeBackPlugin.setMotionEventsHandler(mMotionEventsHandler);
            mEdgeBackPlugin.setLayoutParams(createLayoutParams());
            updateDisplaySize();
        } finally {
            Trace.endSection();
        }
    }

    public boolean isHandlingGestures() {