diff options
author | 2022-11-12 20:22:03 +0000 | |
---|---|---|
committer | 2022-11-12 20:22:03 +0000 | |
commit | a28c45c2b29926560b08d716f5bf2af397fcd7cc (patch) | |
tree | 6a0a1a5e7d2bf69da292580bc29a06124169f839 | |
parent | cdd0be6ea0a368c98d2ac93794e05d0e8be4b70f (diff) | |
parent | f826fd57a9d8da296bdcf38e8ae92ac94c9bae87 (diff) |
Merge "Add logs to aid slow notification measuring investigation" into tm-qpr-dev am: db45ef8514 am: f826fd57a9
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/20438505
Change-Id: Iacba99dc7d073605575fa35e72800039ad09d737
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
7 files changed, 60 insertions, 0 deletions
diff --git a/core/java/com/android/internal/widget/RemeasuringLinearLayout.java b/core/java/com/android/internal/widget/RemeasuringLinearLayout.java index 7b154a54fc85..80d14574955d 100644 --- a/core/java/com/android/internal/widget/RemeasuringLinearLayout.java +++ b/core/java/com/android/internal/widget/RemeasuringLinearLayout.java @@ -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(); } } diff --git a/packages/SystemUI/src/com/android/keyguard/KeyguardStatusView.java b/packages/SystemUI/src/com/android/keyguard/KeyguardStatusView.java index 83e23bd52f19..8b9823be65fd 100644 --- a/packages/SystemUI/src/com/android/keyguard/KeyguardStatusView.java +++ b/packages/SystemUI/src/com/android/keyguard/KeyguardStatusView.java @@ -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(); + } } diff --git a/packages/SystemUI/src/com/android/systemui/shade/NotificationShadeWindowView.java b/packages/SystemUI/src/com/android/systemui/shade/NotificationShadeWindowView.java index e52170e13292..400b0baea01b 100644 --- a/packages/SystemUI/src/com/android/systemui/shade/NotificationShadeWindowView.java +++ b/packages/SystemUI/src/com/android/systemui/shade/NotificationShadeWindowView.java @@ -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; diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/ExpandableNotificationRow.java b/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/ExpandableNotificationRow.java index 3021414847c0..b93e1500e570 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/ExpandableNotificationRow.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/ExpandableNotificationRow.java @@ -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(); } diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationChildrenContainer.java b/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationChildrenContainer.java index 645a02dbda14..d43ca823089f 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationChildrenContainer.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationChildrenContainer.java @@ -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 diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayout.java b/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayout.java index 2c3330e12229..41dbf1d6dc60 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayout.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayout.java @@ -16,6 +16,8 @@ package com.android.systemui.statusbar.notification.stack; +import static android.os.Trace.TRACE_TAG_ALWAYS; + import static com.android.internal.jank.InteractionJankMonitor.CUJ_NOTIFICATION_SHADE_SCROLL_FLING; import static com.android.internal.jank.InteractionJankMonitor.CUJ_SHADE_CLEAR_ALL; import static com.android.systemui.statusbar.notification.stack.NotificationPriorityBucketKt.BUCKET_SILENT; @@ -44,6 +46,7 @@ import android.graphics.Paint; import android.graphics.Path; import android.graphics.Rect; import android.os.Bundle; +import android.os.Trace; import android.provider.Settings; import android.util.AttributeSet; import android.util.IndentingPrintWriter; @@ -1074,6 +1077,12 @@ public class NotificationStackScrollLayout extends ViewGroup implements Dumpable @Override @ShadeViewRefactor(RefactorComponent.SHADE_VIEW) protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) { + Trace.beginSection("NotificationStackScrollLayout#onMeasure"); + if (SPEW) { + Log.d(TAG, "onMeasure(" + + "widthMeasureSpec=" + MeasureSpec.toString(widthMeasureSpec) + ", " + + "heightMeasureSpec=" + MeasureSpec.toString(heightMeasureSpec) + ")"); + } super.onMeasure(widthMeasureSpec, heightMeasureSpec); int width = MeasureSpec.getSize(widthMeasureSpec); @@ -1090,6 +1099,13 @@ public class NotificationStackScrollLayout extends ViewGroup implements Dumpable for (int i = 0; i < size; i++) { measureChild(getChildAt(i), childWidthSpec, childHeightSpec); } + Trace.endSection(); + } + + @Override + public void requestLayout() { + Trace.instant(TRACE_TAG_ALWAYS, "NotificationStackScrollLayout#requestLayout"); + super.requestLayout(); } @Override diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardStatusBarView.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardStatusBarView.java index 18877f9fb437..7a49a495155b 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardStatusBarView.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardStatusBarView.java @@ -26,6 +26,7 @@ import android.content.res.Resources; import android.graphics.Color; import android.graphics.Rect; import android.graphics.drawable.Drawable; +import android.os.Trace; import android.util.AttributeSet; import android.util.Pair; import android.util.TypedValue; @@ -527,4 +528,11 @@ public class KeyguardStatusBarView extends RelativeLayout { mClipRect.set(0, mTopClipping, getWidth(), getHeight()); setClipBounds(mClipRect); } + + @Override + protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) { + Trace.beginSection("KeyguardStatusBarView#onMeasure"); + super.onMeasure(widthMeasureSpec, heightMeasureSpec); + Trace.endSection(); + } } |