Remove atraces from RemeasuringLinearLayout

onMeasure was being called 246 times in 26 ms, and having all those traces was not helping much and causing a few millis of latency.

Bug: 258930580
Test: Recorded a perfetto trace and inspected it manually
Change-Id: I672b785a57fe6c6d78b6a89e68fa57735c225bc7
This commit is contained in:
Nicolo' Mazzucato
2022-11-14 12:46:19 +00:00
parent 8cd94e33fa
commit 03d923dada

View File

@@ -18,7 +18,6 @@ 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;
@@ -55,7 +54,6 @@ 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;
@@ -88,6 +86,5 @@ public class RemeasuringLinearLayout extends LinearLayout {
}
mMatchParentViews.clear();
setMeasuredDimension(getMeasuredWidth(), height);
Trace.endSection();
}
}