summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Ibrahim Yilmaz <iyz@google.com> 2023-07-07 19:52:08 +0000
committer Android (Google) Code Review <android-gerrit@google.com> 2023-07-07 19:52:08 +0000
commitc39845ac363f1057d87502be1884554d6b2409ed (patch)
tree697c388992c9b48e80ee79a2e33bb168ac08b108
parenta819618e7dc7d69a6b4577c3ad1ea1a84d68339f (diff)
parent2f0a514053b8b875dcbd8d581a7bcfdd2d5ef2af (diff)
Merge "Trace ImageFloatingTextView and NotificationToplineView" into udc-qpr-dev
-rw-r--r--core/java/android/view/NotificationTopLineView.java3
-rw-r--r--core/java/com/android/internal/widget/ImageFloatingTextView.java8
2 files changed, 10 insertions, 1 deletions
diff --git a/core/java/android/view/NotificationTopLineView.java b/core/java/android/view/NotificationTopLineView.java
index bd20f5bf82fd..a2919f5bfd74 100644
--- a/core/java/android/view/NotificationTopLineView.java
+++ b/core/java/android/view/NotificationTopLineView.java
@@ -21,6 +21,7 @@ import android.content.Context;
import android.content.res.Resources;
import android.content.res.TypedArray;
import android.graphics.Rect;
+import android.os.Trace;
import android.util.AttributeSet;
import android.widget.RemoteViews;
@@ -106,6 +107,7 @@ public class NotificationTopLineView extends ViewGroup {
@Override
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
+ Trace.beginSection("NotificationTopLineView#onMeasure");
final int givenWidth = MeasureSpec.getSize(widthMeasureSpec);
final int givenHeight = MeasureSpec.getSize(heightMeasureSpec);
final boolean wrapHeight = MeasureSpec.getMode(heightMeasureSpec) == MeasureSpec.AT_MOST;
@@ -161,6 +163,7 @@ public class NotificationTopLineView extends ViewGroup {
.finish();
}
setMeasuredDimension(givenWidth, wrapHeight ? maxChildHeight : givenHeight);
+ Trace.endSection();
}
@Override
diff --git a/core/java/com/android/internal/widget/ImageFloatingTextView.java b/core/java/com/android/internal/widget/ImageFloatingTextView.java
index 1ac5e1f12bfa..de10bd2f47d7 100644
--- a/core/java/com/android/internal/widget/ImageFloatingTextView.java
+++ b/core/java/com/android/internal/widget/ImageFloatingTextView.java
@@ -18,6 +18,7 @@ package com.android.internal.widget;
import android.annotation.Nullable;
import android.content.Context;
+import android.os.Trace;
import android.text.BoringLayout;
import android.text.Layout;
import android.text.StaticLayout;
@@ -68,6 +69,7 @@ public class ImageFloatingTextView extends TextView {
protected Layout makeSingleLayout(int wantWidth, BoringLayout.Metrics boring, int ellipsisWidth,
Layout.Alignment alignment, boolean shouldEllipsize,
TextUtils.TruncateAt effectiveEllipsize, boolean useSaved) {
+ Trace.beginSection("ImageFloatingTextView#makeSingleLayout");
TransformationMethod transformationMethod = getTransformationMethod();
CharSequence text = getText();
if (transformationMethod != null) {
@@ -110,7 +112,9 @@ public class ImageFloatingTextView extends TextView {
builder.setIndents(null, margins);
}
- return builder.build();
+ final StaticLayout result = builder.build();
+ Trace.endSection();
+ return result;
}
/**
@@ -135,6 +139,7 @@ public class ImageFloatingTextView extends TextView {
@Override
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
+ Trace.beginSection("ImageFloatingTextView#onMeasure");
int availableHeight = MeasureSpec.getSize(heightMeasureSpec) - mPaddingTop - mPaddingBottom;
if (getLayout() != null && getLayout().getHeight() != availableHeight) {
// We've been measured before and the new size is different than before, lets make sure
@@ -161,6 +166,7 @@ public class ImageFloatingTextView extends TextView {
super.onMeasure(widthMeasureSpec, heightMeasureSpec);
}
}
+ Trace.endSection();
}
@Override