From af47fa737173b72c76c7f46521b5d320625c5315 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A1s=20Kurucz?= Date: Mon, 17 Apr 2023 10:05:40 +0000 Subject: [PATCH] Update RoundableState logs The dump of the NotificationShadeWindowControllerImpl contains its view hierarchy using the `toString()` method of the `View` class. We want to keep it, because it contains some basic description of the View state, visibility, clickability and the view's position inside its parent. The dump of the NotificationStackScrollLayout knows more about our custom views and their custom properties. This CL updates the RoundableState logs to follow this pattern. Fixes: 278509751 Test: dumpsysui NotificationStackScrollLayout NotificationShadeWindowControllerImpl Change-Id: Id64fc6e8ed692c530aace95eb3036c0b37af647a --- .../systemui/statusbar/notification/Roundable.kt | 10 +++++----- .../row/ExpandableNotificationRow.java | 14 ++------------ .../notification/row/ExpandableOutlineView.java | 2 +- .../stack/NotificationChildrenContainer.java | 10 ++++++---- 4 files changed, 14 insertions(+), 22 deletions(-) diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/Roundable.kt b/packages/SystemUI/src/com/android/systemui/statusbar/notification/Roundable.kt index 6deef2e118281..76ff97ddb61bb 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/Roundable.kt +++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/Roundable.kt @@ -383,11 +383,11 @@ class RoundableState( } fun debugString() = buildString { - append("TargetView: ${targetView.hashCode()} ") - append("Top: $topRoundness ") - append(topRoundnessMap.map { "${it.key} ${it.value}" }) - append(" Bottom: $bottomRoundness ") - append(bottomRoundnessMap.map { "${it.key} ${it.value}" }) + append("Roundable { ") + append("top: { value: $topRoundness, requests: $topRoundnessMap}") + append(", ") + append("bottom: { value: $bottomRoundness, requests: $bottomRoundnessMap}") + append("}") } companion object { 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 10cdae3b967c7..e468a59d4eb13 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 @@ -3649,16 +3649,12 @@ public class ExpandableNotificationRow extends ActivatableNotificationView } else { pw.println("no viewState!!!"); } - pw.println("Roundness: " + getRoundableState().debugString()); + pw.println(getRoundableState().debugString()); int transientViewCount = mChildrenContainer == null ? 0 : mChildrenContainer.getTransientViewCount(); if (mIsSummaryWithChildren || transientViewCount > 0) { - pw.println(); - pw.print("ChildrenContainer"); - pw.print(" visibility: " + mChildrenContainer.getVisibility()); - pw.print(", alpha: " + mChildrenContainer.getAlpha()); - pw.print(", translationY: " + mChildrenContainer.getTranslationY()); + pw.println(mChildrenContainer.debugString()); pw.println(); List notificationChildren = getAttachedChildren(); pw.print("Children: " + notificationChildren.size() + " {"); @@ -3725,12 +3721,6 @@ public class ExpandableNotificationRow extends ActivatableNotificationView } } - @Override - public String toString() { - String roundableStateDebug = "RoundableState = " + getRoundableState().debugString(); - return "ExpandableNotificationRow:" + hashCode() + " { " + roundableStateDebug + " }"; - } - @Override protected void onAttachedToWindow() { super.onAttachedToWindow(); diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/ExpandableOutlineView.java b/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/ExpandableOutlineView.java index 197caa2d56452..9aa50e989ff14 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/ExpandableOutlineView.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/ExpandableOutlineView.java @@ -352,7 +352,7 @@ public abstract class ExpandableOutlineView extends ExpandableView { IndentingPrintWriter pw = DumpUtilsKt.asIndenting(pwOriginal); super.dump(pw, args); DumpUtilsKt.withIncreasedIndent(pw, () -> { - pw.println("Roundness: " + getRoundableState().debugString()); + pw.println(getRoundableState().debugString()); if (DUMP_VERBOSE) { pw.println("mCustomOutline: " + mCustomOutline + " mOutlineRect: " + mOutlineRect); pw.println("mOutlineAlpha: " + mOutlineAlpha); 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 40f55bd3726c2..160a2309bfccb 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 @@ -1546,9 +1546,11 @@ public class NotificationChildrenContainer extends ViewGroup mUseRoundnessSourceTypes = enabled; } - @Override - public String toString() { - String roundableStateDebug = "RoundableState = " + getRoundableState().debugString(); - return "NotificationChildrenContainer:" + hashCode() + " { " + roundableStateDebug + " }"; + public String debugString() { + return TAG + " { " + + "visibility: " + getVisibility() + + ", alpha: " + getAlpha() + + ", translationY: " + getTranslationY() + + ", roundableState: " + getRoundableState().debugString() + "}"; } }