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

Commit 318f6d69 authored by Nicolo' Mazzucato's avatar Nicolo' Mazzucato
Browse files

Add logs to aid slow notification measuring investigation

Bug: 245268301
Bug: 243647188
Test: Recorded a perfetto trace and inspected it manually
Change-Id: I33ca2e0c7e9f71c97acca90eb0a29293e58c0442
parent 1b5ae517
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -18,6 +18,7 @@ package com.android.internal.widget;

import android.annotation.Nullable;
import android.content.Context;
import android.os.Trace;
import android.util.AttributeSet;
import android.view.View;
import android.widget.LinearLayout;
@@ -54,6 +55,7 @@ public class RemeasuringLinearLayout extends LinearLayout {

    @Override
    protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
        Trace.beginSection("RemeasuringLinearLayout#onMeasure");
        super.onMeasure(widthMeasureSpec, heightMeasureSpec);
        int count = getChildCount();
        int height = 0;
@@ -86,5 +88,6 @@ public class RemeasuringLinearLayout extends LinearLayout {
        }
        mMatchParentViews.clear();
        setMeasuredDimension(getMeasuredWidth(), height);
        Trace.endSection();
    }
}
+8 −0
Original line number Diff line number Diff line
@@ -17,6 +17,7 @@
package com.android.keyguard;

import android.content.Context;
import android.os.Trace;
import android.util.AttributeSet;
import android.view.View;
import android.view.ViewGroup;
@@ -112,4 +113,11 @@ public class KeyguardStatusView extends GridLayout {
            mKeyguardSlice.dump(pw, args);
        }
    }

    @Override
    protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
        Trace.beginSection("KeyguardStatusView#onMeasure");
        super.onMeasure(widthMeasureSpec, heightMeasureSpec);
        Trace.endSection();
    }
}
+15 −0
Original line number Diff line number Diff line
@@ -16,6 +16,7 @@

package com.android.systemui.shade;

import static android.os.Trace.TRACE_TAG_ALWAYS;
import static android.view.WindowInsets.Type.systemBars;

import static com.android.systemui.statusbar.phone.CentralSurfaces.DEBUG;
@@ -33,6 +34,7 @@ import android.graphics.Rect;
import android.graphics.drawable.Drawable;
import android.net.Uri;
import android.os.Bundle;
import android.os.Trace;
import android.util.AttributeSet;
import android.view.ActionMode;
import android.view.DisplayCutout;
@@ -299,6 +301,19 @@ public class NotificationShadeWindowView extends FrameLayout {
        return mode;
    }

    @Override
    protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
        Trace.beginSection("NotificationShadeWindowView#onMeasure");
        super.onMeasure(widthMeasureSpec, heightMeasureSpec);
        Trace.endSection();
    }

    @Override
    public void requestLayout() {
        Trace.instant(TRACE_TAG_ALWAYS, "NotificationShadeWindowView#requestLayout");
        super.requestLayout();
    }

    private class ActionModeCallback2Wrapper extends ActionMode.Callback2 {
        private final ActionMode.Callback mWrapped;

+7 −0
Original line number Diff line number Diff line
@@ -135,6 +135,8 @@ public class ExpandableNotificationRow extends ActivatableNotificationView

    private static final String TAG = "ExpandableNotifRow";
    private static final boolean DEBUG = Compile.IS_DEBUG && Log.isLoggable(TAG, Log.DEBUG);
    private static final boolean DEBUG_ONMEASURE =
            Compile.IS_DEBUG && Log.isLoggable(TAG, Log.VERBOSE);
    private static final int DEFAULT_DIVIDER_ALPHA = 0x29;
    private static final int COLORED_DIVIDER_ALPHA = 0x7B;
    private static final int MENU_VIEW_INDEX = 0;
@@ -1724,6 +1726,11 @@ public class ExpandableNotificationRow extends ActivatableNotificationView
    @Override
    protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
        Trace.beginSection(appendTraceStyleTag("ExpNotRow#onMeasure"));
        if (DEBUG_ONMEASURE) {
            Log.d(TAG, "onMeasure("
                    + "widthMeasureSpec=" + MeasureSpec.toString(widthMeasureSpec) + ", "
                    + "heightMeasureSpec=" + MeasureSpec.toString(heightMeasureSpec) + ")");
        }
        super.onMeasure(widthMeasureSpec, heightMeasureSpec);
        Trace.endSection();
    }
+3 −0
Original line number Diff line number Diff line
@@ -25,6 +25,7 @@ import android.graphics.Canvas;
import android.graphics.Path;
import android.graphics.Path.Direction;
import android.graphics.drawable.ColorDrawable;
import android.os.Trace;
import android.service.notification.StatusBarNotification;
import android.util.AttributeSet;
import android.util.Log;
@@ -219,6 +220,7 @@ public class NotificationChildrenContainer extends ViewGroup

    @Override
    protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
        Trace.beginSection("NotificationChildrenContainer#onMeasure");
        int heightMode = MeasureSpec.getMode(heightMeasureSpec);
        boolean hasFixedHeight = heightMode == MeasureSpec.EXACTLY;
        boolean isHeightLimited = heightMode == MeasureSpec.AT_MOST;
@@ -267,6 +269,7 @@ public class NotificationChildrenContainer extends ViewGroup
        }

        setMeasuredDimension(width, height);
        Trace.endSection();
    }

    @Override
Loading