From 9e25f0929c001f322f02d6ff9334bde34ff7a6da Mon Sep 17 00:00:00 2001 From: Jeff DeCew Date: Tue, 2 Aug 2022 10:11:25 +0000 Subject: [PATCH] Log when child views are freed This log was missing and made it harder to tell what was happening when debugging the given bug Bug: 240857315 Test: dumpsysui NotifLog Change-Id: Ie1c25aa682858c88b9afb33cf5fe74d92d7db9b6 --- .../coordinator/PreparationCoordinator.java | 5 +++-- .../coordinator/PreparationCoordinatorLogger.kt | 15 ++++++++++++--- 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/collection/coordinator/PreparationCoordinator.java b/packages/SystemUI/src/com/android/systemui/statusbar/notification/collection/coordinator/PreparationCoordinator.java index ef1e57b4cd3b3..6e76691ae1b10 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/collection/coordinator/PreparationCoordinator.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/collection/coordinator/PreparationCoordinator.java @@ -286,7 +286,7 @@ public class PreparationCoordinator implements Coordinator { if (isInflated(child)) { // TODO: May want to put an animation hint here so view manager knows to treat // this differently from a regular removal animation - freeNotifViews(child); + freeNotifViews(child, "Past last visible group child"); } } } @@ -379,7 +379,8 @@ public class PreparationCoordinator implements Coordinator { mNotifInflatingFilter.invalidateList("onInflationFinished for " + logKey(entry)); } - private void freeNotifViews(NotificationEntry entry) { + private void freeNotifViews(NotificationEntry entry, String reason) { + mLogger.logFreeNotifViews(entry, reason); mViewBarn.removeViewForEntry(entry); mNotifInflater.releaseViews(entry); // TODO: clear the entry's row here, or even better, stop setting the row on the entry! diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/collection/coordinator/PreparationCoordinatorLogger.kt b/packages/SystemUI/src/com/android/systemui/statusbar/notification/collection/coordinator/PreparationCoordinatorLogger.kt index 30f13152126c8..c4f4ed54e2fa3 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/collection/coordinator/PreparationCoordinatorLogger.kt +++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/collection/coordinator/PreparationCoordinatorLogger.kt @@ -31,7 +31,7 @@ class PreparationCoordinatorLogger @Inject constructor( buffer.log(TAG, LogLevel.DEBUG, { str1 = entry.logKey }, { - "NOTIF INFLATED $str1" + "Inflation completed for notif $str1" }) } @@ -40,7 +40,16 @@ class PreparationCoordinatorLogger @Inject constructor( str1 = entry.logKey str2 = reason }, { - "NOTIF INFLATION ABORTED $str1 reason=$str2" + "Infation aborted for notif $str1 reason=$str2" + }) + } + + fun logFreeNotifViews(entry: NotificationEntry, reason: String) { + buffer.log(TAG, LogLevel.DEBUG, { + str1 = entry.logKey + str2 = reason + }, { + "Freeing content views for notif $str1 reason=$str2" }) } @@ -70,4 +79,4 @@ class PreparationCoordinatorLogger @Inject constructor( } } -private const val TAG = "PreparationCoordinator" \ No newline at end of file +private const val TAG = "PreparationCoordinator"