Merge "Add logs to aid slow notification measuring investigation" into tm-qpr-dev am: db45ef8514

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/20438505

Change-Id: I44e7999269a4f348474b96316ff71b62bc861d3f
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
TreeHugger Robot
2022-11-12 19:33:51 +00:00
committed by Automerger Merge Worker
7 changed files with 60 additions and 0 deletions

View File

@@ -18,6 +18,7 @@ package com.android.internal.widget;
import android.annotation.Nullable; import android.annotation.Nullable;
import android.content.Context; import android.content.Context;
import android.os.Trace;
import android.util.AttributeSet; import android.util.AttributeSet;
import android.view.View; import android.view.View;
import android.widget.LinearLayout; import android.widget.LinearLayout;
@@ -54,6 +55,7 @@ public class RemeasuringLinearLayout extends LinearLayout {
@Override @Override
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) { protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
Trace.beginSection("RemeasuringLinearLayout#onMeasure");
super.onMeasure(widthMeasureSpec, heightMeasureSpec); super.onMeasure(widthMeasureSpec, heightMeasureSpec);
int count = getChildCount(); int count = getChildCount();
int height = 0; int height = 0;
@@ -86,5 +88,6 @@ public class RemeasuringLinearLayout extends LinearLayout {
} }
mMatchParentViews.clear(); mMatchParentViews.clear();
setMeasuredDimension(getMeasuredWidth(), height); setMeasuredDimension(getMeasuredWidth(), height);
Trace.endSection();
} }
} }

View File

@@ -17,6 +17,7 @@
package com.android.keyguard; package com.android.keyguard;
import android.content.Context; import android.content.Context;
import android.os.Trace;
import android.util.AttributeSet; import android.util.AttributeSet;
import android.view.View; import android.view.View;
import android.view.ViewGroup; import android.view.ViewGroup;
@@ -112,4 +113,11 @@ public class KeyguardStatusView extends GridLayout {
mKeyguardSlice.dump(pw, args); mKeyguardSlice.dump(pw, args);
} }
} }
@Override
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
Trace.beginSection("KeyguardStatusView#onMeasure");
super.onMeasure(widthMeasureSpec, heightMeasureSpec);
Trace.endSection();
}
} }

View File

@@ -16,6 +16,7 @@
package com.android.systemui.shade; package com.android.systemui.shade;
import static android.os.Trace.TRACE_TAG_ALWAYS;
import static android.view.WindowInsets.Type.systemBars; import static android.view.WindowInsets.Type.systemBars;
import static com.android.systemui.statusbar.phone.CentralSurfaces.DEBUG; import static com.android.systemui.statusbar.phone.CentralSurfaces.DEBUG;
@@ -33,6 +34,7 @@ import android.graphics.Rect;
import android.graphics.drawable.Drawable; import android.graphics.drawable.Drawable;
import android.net.Uri; import android.net.Uri;
import android.os.Bundle; import android.os.Bundle;
import android.os.Trace;
import android.util.AttributeSet; import android.util.AttributeSet;
import android.view.ActionMode; import android.view.ActionMode;
import android.view.DisplayCutout; import android.view.DisplayCutout;
@@ -299,6 +301,19 @@ public class NotificationShadeWindowView extends FrameLayout {
return mode; 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 class ActionModeCallback2Wrapper extends ActionMode.Callback2 {
private final ActionMode.Callback mWrapped; private final ActionMode.Callback mWrapped;

View File

@@ -135,6 +135,8 @@ public class ExpandableNotificationRow extends ActivatableNotificationView
private static final String TAG = "ExpandableNotifRow"; private static final String TAG = "ExpandableNotifRow";
private static final boolean DEBUG = Compile.IS_DEBUG && Log.isLoggable(TAG, Log.DEBUG); 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 DEFAULT_DIVIDER_ALPHA = 0x29;
private static final int COLORED_DIVIDER_ALPHA = 0x7B; private static final int COLORED_DIVIDER_ALPHA = 0x7B;
private static final int MENU_VIEW_INDEX = 0; private static final int MENU_VIEW_INDEX = 0;
@@ -1724,6 +1726,11 @@ public class ExpandableNotificationRow extends ActivatableNotificationView
@Override @Override
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) { protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
Trace.beginSection(appendTraceStyleTag("ExpNotRow#onMeasure")); Trace.beginSection(appendTraceStyleTag("ExpNotRow#onMeasure"));
if (DEBUG_ONMEASURE) {
Log.d(TAG, "onMeasure("
+ "widthMeasureSpec=" + MeasureSpec.toString(widthMeasureSpec) + ", "
+ "heightMeasureSpec=" + MeasureSpec.toString(heightMeasureSpec) + ")");
}
super.onMeasure(widthMeasureSpec, heightMeasureSpec); super.onMeasure(widthMeasureSpec, heightMeasureSpec);
Trace.endSection(); Trace.endSection();
} }

View File

@@ -25,6 +25,7 @@ import android.graphics.Canvas;
import android.graphics.Path; import android.graphics.Path;
import android.graphics.Path.Direction; import android.graphics.Path.Direction;
import android.graphics.drawable.ColorDrawable; import android.graphics.drawable.ColorDrawable;
import android.os.Trace;
import android.service.notification.StatusBarNotification; import android.service.notification.StatusBarNotification;
import android.util.AttributeSet; import android.util.AttributeSet;
import android.util.Log; import android.util.Log;
@@ -219,6 +220,7 @@ public class NotificationChildrenContainer extends ViewGroup
@Override @Override
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) { protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
Trace.beginSection("NotificationChildrenContainer#onMeasure");
int heightMode = MeasureSpec.getMode(heightMeasureSpec); int heightMode = MeasureSpec.getMode(heightMeasureSpec);
boolean hasFixedHeight = heightMode == MeasureSpec.EXACTLY; boolean hasFixedHeight = heightMode == MeasureSpec.EXACTLY;
boolean isHeightLimited = heightMode == MeasureSpec.AT_MOST; boolean isHeightLimited = heightMode == MeasureSpec.AT_MOST;
@@ -267,6 +269,7 @@ public class NotificationChildrenContainer extends ViewGroup
} }
setMeasuredDimension(width, height); setMeasuredDimension(width, height);
Trace.endSection();
} }
@Override @Override

View File

@@ -16,6 +16,8 @@
package com.android.systemui.statusbar.notification.stack; 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_NOTIFICATION_SHADE_SCROLL_FLING;
import static com.android.internal.jank.InteractionJankMonitor.CUJ_SHADE_CLEAR_ALL; import static com.android.internal.jank.InteractionJankMonitor.CUJ_SHADE_CLEAR_ALL;
import static com.android.systemui.statusbar.notification.stack.NotificationPriorityBucketKt.BUCKET_SILENT; 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.Path;
import android.graphics.Rect; import android.graphics.Rect;
import android.os.Bundle; import android.os.Bundle;
import android.os.Trace;
import android.provider.Settings; import android.provider.Settings;
import android.util.AttributeSet; import android.util.AttributeSet;
import android.util.IndentingPrintWriter; import android.util.IndentingPrintWriter;
@@ -1074,6 +1077,12 @@ public class NotificationStackScrollLayout extends ViewGroup implements Dumpable
@Override @Override
@ShadeViewRefactor(RefactorComponent.SHADE_VIEW) @ShadeViewRefactor(RefactorComponent.SHADE_VIEW)
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) { 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); super.onMeasure(widthMeasureSpec, heightMeasureSpec);
int width = MeasureSpec.getSize(widthMeasureSpec); int width = MeasureSpec.getSize(widthMeasureSpec);
@@ -1090,6 +1099,13 @@ public class NotificationStackScrollLayout extends ViewGroup implements Dumpable
for (int i = 0; i < size; i++) { for (int i = 0; i < size; i++) {
measureChild(getChildAt(i), childWidthSpec, childHeightSpec); measureChild(getChildAt(i), childWidthSpec, childHeightSpec);
} }
Trace.endSection();
}
@Override
public void requestLayout() {
Trace.instant(TRACE_TAG_ALWAYS, "NotificationStackScrollLayout#requestLayout");
super.requestLayout();
} }
@Override @Override

View File

@@ -26,6 +26,7 @@ import android.content.res.Resources;
import android.graphics.Color; import android.graphics.Color;
import android.graphics.Rect; import android.graphics.Rect;
import android.graphics.drawable.Drawable; import android.graphics.drawable.Drawable;
import android.os.Trace;
import android.util.AttributeSet; import android.util.AttributeSet;
import android.util.Pair; import android.util.Pair;
import android.util.TypedValue; import android.util.TypedValue;
@@ -527,4 +528,11 @@ public class KeyguardStatusBarView extends RelativeLayout {
mClipRect.set(0, mTopClipping, getWidth(), getHeight()); mClipRect.set(0, mTopClipping, getWidth(), getHeight());
setClipBounds(mClipRect); setClipBounds(mClipRect);
} }
@Override
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
Trace.beginSection("KeyguardStatusBarView#onMeasure");
super.onMeasure(widthMeasureSpec, heightMeasureSpec);
Trace.endSection();
}
} }