diff options
| author | 2023-06-14 18:06:08 +0000 | |
|---|---|---|
| committer | 2023-06-21 17:58:43 +0000 | |
| commit | 9e68755ff47841b355670dbbe88fef767dd732be (patch) | |
| tree | 2cbfed2de2b4b058c603da6e7e206cd3e7f159c2 | |
| parent | f8277c1d020fe96b0b4e49054c705d3f99dc2d7b (diff) | |
Add logs for all ExpandableNotificationRow transient views adding to and removing from ExpandableNotificationRow
Add logs for all ExpandableNotificationRow transient views that are added to and removed from ExpandableNotificationRow. To help with:
1. determining if the known additions and removals are working as intended (especially in a good order) .
2. discovering unknown additions and removals of transient rows.
Bug: 281628358
Test: `adb shell settings put global systemui/buffer/NotifRenderLog
VERBOSE` and look for NotifRow tag in logcat
Change-Id: Ie05df2479c119de258d6e95ccd3262ddf58e5ebb
3 files changed, 98 insertions, 0 deletions
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 7cbedf4c1713..30747db0fb64 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 @@ -1657,6 +1657,25 @@ public class ExpandableNotificationRow extends ActivatableNotificationView NotificationEntry childEntry, ViewGroup containerView ); + + /** + * Called when an ExpandableNotificationRow transient view is added to this + * ExpandableNotificationRow + */ + void logAddTransientRow( + NotificationEntry childEntry, + NotificationEntry containerEntry, + int index + ); + + /** + * Called when an ExpandableNotificationRow transient view is removed from this + * ExpandableNotificationRow + */ + void logRemoveTransientRow( + NotificationEntry childEntry, + NotificationEntry containerEntry + ); } /** @@ -3786,4 +3805,34 @@ public class ExpandableNotificationRow extends ActivatableNotificationView ); } } + + @Override + public void addTransientView(View view, int index) { + if (view instanceof ExpandableNotificationRow) { + logAddTransientRow((ExpandableNotificationRow) view, index); + } + super.addTransientView(view, index); + } + + private void logAddTransientRow(ExpandableNotificationRow row, int index) { + if (mLogger == null) { + return; + } + mLogger.logAddTransientRow(row.getEntry(), getEntry(), index); + } + + @Override + public void removeTransientView(View view) { + if (view instanceof ExpandableNotificationRow) { + logRemoveTransientRow((ExpandableNotificationRow) view); + } + super.removeTransientView(view); + } + + private void logRemoveTransientRow(ExpandableNotificationRow row) { + if (mLogger == null) { + return; + } + mLogger.logRemoveTransientRow(row.getEntry(), getEntry()); + } } diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/ExpandableNotificationRowController.java b/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/ExpandableNotificationRowController.java index 7e6e551ed816..a4e8c2ece894 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/ExpandableNotificationRowController.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/ExpandableNotificationRowController.java @@ -150,6 +150,23 @@ public class ExpandableNotificationRowController implements NotifViewController ) { mLogBufferLogger.logRemoveTransientFromViewGroup(childEntry, containerView); } + + @Override + public void logAddTransientRow( + NotificationEntry childEntry, + NotificationEntry containerEntry, + int index + ) { + mLogBufferLogger.logAddTransientRow(childEntry, containerEntry, index); + } + + @Override + public void logRemoveTransientRow( + NotificationEntry childEntry, + NotificationEntry containerEntry + ) { + mLogBufferLogger.logRemoveTransientRow(childEntry, containerEntry); + } }; diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/NotificationRowLogger.kt b/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/NotificationRowLogger.kt index efafb66f6ea2..89338f9eeed3 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/NotificationRowLogger.kt +++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/NotificationRowLogger.kt @@ -96,6 +96,38 @@ constructor( { "RemoveTransientRow from other ViewGroup: childKey: $str1 -- ViewGroup: $str2" } ) } + + fun logAddTransientRow( + childEntry: NotificationEntry, + containerEntry: NotificationEntry, + index: Int + ) { + notificationRenderBuffer.log( + TAG, + LogLevel.ERROR, + { + str1 = childEntry.logKey + str2 = containerEntry.logKey + int1 = index + }, + { "addTransientRow to row: childKey: $str1 -- containerKey: $str2 -- index: $int1" } + ) + } + + fun logRemoveTransientRow( + childEntry: NotificationEntry, + containerEntry: NotificationEntry, + ) { + notificationRenderBuffer.log( + TAG, + LogLevel.ERROR, + { + str1 = childEntry.logKey + str2 = containerEntry.logKey + }, + { "removeTransientRow from row: childKey: $str1 -- containerKey: $str2" } + ) + } } private const val TAG = "NotifRow" |