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

Commit 29e5628c authored by Nicolo' Mazzucato's avatar Nicolo' Mazzucato
Browse files

Add traces for slow operations during unfold

This allows us to track those slow operations between builds and monitor improvements.

Bug: 312931238
Bug: 312924264
Bug: 312894757
Bug: 309929619
Flag: None
Test: perfetto trace
Change-Id: Ie090e5de89f904791b74f20071af30e5f0571a76
parent 73330b61
Loading
Loading
Loading
Loading
+20 −9
Original line number Diff line number Diff line
@@ -72,6 +72,7 @@ import android.os.Bundle;
import android.os.Handler;
import android.os.IBinder;
import android.os.RemoteException;
import android.os.Trace;
import android.provider.DeviceConfig;
import android.telecom.TelecomManager;
import android.text.TextUtils;
@@ -736,9 +737,16 @@ public class NavigationBar extends ViewController<NavigationBarView> implements
    }

    public void destroyView() {
        Trace.beginSection("NavigationBar#destroyView");
        try {
            setAutoHideController(/* autoHideController */ null);
            mCommandQueue.removeCallback(this);
            Trace.beginSection("NavigationBar#removeViewImmediate");
            try {
                mWindowManager.removeViewImmediate(mView.getRootView());
            } finally {
                Trace.endSection();
            }
            mNavigationModeController.removeListener(mModeChangedListener);
            mEdgeBackGestureHandler.setStateChangeCallback(null);

@@ -747,6 +755,9 @@ public class NavigationBar extends ViewController<NavigationBarView> implements

            mDeviceConfigProxy.removeOnPropertiesChangedListener(mOnPropertiesChangedListener);
            mTaskStackChangeListeners.unregisterTaskStackListener(mTaskStackListener);
        } finally {
            Trace.endSection();
        }
    }

    @Override
+28 −21
Original line number Diff line number Diff line
@@ -46,6 +46,7 @@ import android.hardware.display.DisplayManager;
import android.inputmethodservice.InputMethodService;
import android.os.IBinder;
import android.os.RemoteException;
import android.os.Trace;
import android.util.Log;
import android.view.Display;
import android.view.View;
@@ -229,6 +230,8 @@ public class TaskbarDelegate implements CommandQueue.Callbacks,
    }

    public void init(int displayId) {
        Trace.beginSection("TaskbarDelegate#init");
        try {
            if (mInitialized) {
                return;
            }
@@ -248,9 +251,13 @@ public class TaskbarDelegate implements CommandQueue.Callbacks,
            mLightBarController.setNavigationBar(mLightBarTransitionsController);
            mPipOptional.ifPresent(this::addPipExclusionBoundsChangeListener);
            mEdgeBackGestureHandler.setBackAnimation(mBackAnimation);
        mEdgeBackGestureHandler.onConfigurationChanged(mContext.getResources().getConfiguration());
            mEdgeBackGestureHandler.onConfigurationChanged(
                    mContext.getResources().getConfiguration());
            mTaskStackChangeListeners.registerTaskStackListener(mTaskStackListener);
            mInitialized = true;
        } finally {
            Trace.endSection();
        }
    }

    public void destroy() {
+9 −4
Original line number Diff line number Diff line
@@ -578,10 +578,15 @@ public class EdgeBackGestureHandler implements PluginListener<NavigationEdgeBack
     * @see NavigationModeController.ModeChangedListener#onNavigationModeChanged
     */
    public void onNavigationModeChanged(int mode) {
        Trace.beginSection("EdgeBackGestureHandler#onNavigationModeChanged");
        try {
            mUsingThreeButtonNav = QuickStepContract.isLegacyMode(mode);
            mInGestureNavMode = QuickStepContract.isGesturalMode(mode);
            updateIsEnabled();
            updateCurrentUserResources();
        } finally {
            Trace.endSection();
        }
    }

    public void onNavBarTransientStateChanged(boolean isTransient) {
+2 −1
Original line number Diff line number Diff line
@@ -45,6 +45,7 @@ import android.widget.LinearLayout
import android.widget.Switch
import android.widget.TextView
import androidx.annotation.VisibleForTesting
import com.android.app.tracing.traceSection
import com.android.settingslib.Utils
import com.android.systemui.FontSizeUtils
import com.android.systemui.animation.LaunchableView
@@ -707,7 +708,7 @@ open class QSTileViewImpl @JvmOverloads constructor(

    inner class StateChangeRunnable(private val state: QSTile.State) : Runnable {
        override fun run() {
            handleStateChanged(state)
            traceSection("QSTileViewImpl#handleStateChanged") { handleStateChanged(state) }
        }

        // We want all instances of this runnable to be equal to each other, so they can be used to
+2 −0
Original line number Diff line number Diff line
@@ -1302,6 +1302,7 @@ public final class NotificationPanelViewController implements ShadeSurface, Dump

    @Override
    public void updateResources() {
        Trace.beginSection("NSSLC#updateResources");
        final boolean newSplitShadeEnabled =
                mSplitShadeStateController.shouldUseSplitNotificationShade(mResources);
        final boolean splitShadeChanged = mSplitShadeEnabled != newSplitShadeEnabled;
@@ -1318,6 +1319,7 @@ public final class NotificationPanelViewController implements ShadeSurface, Dump

        mSplitShadeFullTransitionDistance =
                mResources.getDimensionPixelSize(R.dimen.split_shade_full_transition_distance);
        Trace.endSection();
    }

    private void onSplitShadeEnabledChanged() {
Loading