From c8b4af613d2322e24ec242e2c31d825e41f874d4 Mon Sep 17 00:00:00 2001 From: Jeff DeCew Date: Fri, 27 May 2022 19:41:43 +0000 Subject: [PATCH] Log the attachment index We log the index when moving a view but not when attaching. This is an incredibly low-risk way to have better indications of when unexpected views (such as the silent header) exist in the shade. It will also add information about where views were attached without having to enable verbose logging. Bug: 224929774 Bug: 234824085 Test: dumpsysui NotifLog Change-Id: Iac7a9d4e6fe505050a1a55afe78a8ead46af37a7 --- .../notification/collection/render/ShadeViewDiffer.kt | 2 +- .../notification/collection/render/ShadeViewDifferLogger.kt | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/collection/render/ShadeViewDiffer.kt b/packages/SystemUI/src/com/android/systemui/statusbar/notification/collection/render/ShadeViewDiffer.kt index f460644ce71ce..9a9941e7a19c7 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/collection/render/ShadeViewDiffer.kt +++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/collection/render/ShadeViewDiffer.kt @@ -123,7 +123,7 @@ class ShadeViewDiffer( when (childNode.parent) { null -> { // A new child (either newly created or coming from some other parent) - logger.logAttachingChild(childNode.label, parentNode.label) + logger.logAttachingChild(childNode.label, parentNode.label, index) parentNode.addChildAt(childNode, index) childNode.parent = parentNode } diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/collection/render/ShadeViewDifferLogger.kt b/packages/SystemUI/src/com/android/systemui/statusbar/notification/collection/render/ShadeViewDifferLogger.kt index 4c0357243d489..6d1071c283e30 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/collection/render/ShadeViewDifferLogger.kt +++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/collection/render/ShadeViewDifferLogger.kt @@ -43,12 +43,13 @@ class ShadeViewDifferLogger @Inject constructor( }) } - fun logAttachingChild(key: String, parent: String) { + fun logAttachingChild(key: String, parent: String, atIndex: Int) { buffer.log(TAG, LogLevel.DEBUG, { str1 = key str2 = parent + int1 = atIndex }, { - "Attaching view $str1 to $str2" + "Attaching view $str1 to $str2 at index $int1" }) }