diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/collection/NotifCollection.java b/packages/SystemUI/src/com/android/systemui/statusbar/notification/collection/NotifCollection.java index d7365e6db9354..45987b6eb21ba 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/collection/NotifCollection.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/collection/NotifCollection.java @@ -281,6 +281,8 @@ public class NotifCollection implements Dumpable { Assert.isMainThread(); checkForReentrantCall(); + mLogger.logDismissAll(userId); + try { mStatusBarService.onClearAllNotifications(userId); } catch (RemoteException e) { @@ -327,6 +329,7 @@ public class NotifCollection implements Dumpable { for (NotificationEntry otherEntry : mNotificationSet.values()) { if (shouldAutoDismissChildren(otherEntry, entry.getSbn().getGroupKey())) { otherEntry.setDismissState(PARENT_DISMISSED); + mLogger.logChildDismissed(otherEntry); if (isCanceled(otherEntry)) { canceledEntries.add(otherEntry); } @@ -339,6 +342,7 @@ public class NotifCollection implements Dumpable { // Immediately remove any dismissed notifs that have already been canceled by system server // (probably due to being lifetime-extended up until this point). for (NotificationEntry canceledEntry : canceledEntries) { + mLogger.logDismissOnAlreadyCanceledEntry(canceledEntry); tryRemoveNotification(canceledEntry); } } @@ -453,6 +457,7 @@ public class NotifCollection implements Dumpable { } if (!isLifetimeExtended(entry)) { + mLogger.logNotifReleased(entry.getKey()); mNotificationSet.remove(entry.getKey()); cancelDismissInterception(entry); mEventQueue.add(new EntryRemovedEvent(entry, entry.mCancellationReason)); diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/collection/notifcollection/NotifCollectionLogger.kt b/packages/SystemUI/src/com/android/systemui/statusbar/notification/collection/notifcollection/NotifCollectionLogger.kt index c69882d5b83c2..0eb2d64e86822 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/collection/notifcollection/NotifCollectionLogger.kt +++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/collection/notifcollection/NotifCollectionLogger.kt @@ -24,6 +24,7 @@ import com.android.systemui.log.LogLevel.INFO import com.android.systemui.log.LogLevel.WARNING import com.android.systemui.log.LogLevel.WTF import com.android.systemui.log.dagger.NotificationLog +import com.android.systemui.statusbar.notification.collection.NotificationEntry import javax.inject.Inject class NotifCollectionLogger @Inject constructor( @@ -63,6 +64,14 @@ class NotifCollectionLogger @Inject constructor( }) } + fun logNotifReleased(key: String) { + buffer.log(TAG, INFO, { + str1 = key + }, { + "RELEASED $str1" + }) + } + fun logNotifDismissed(key: String) { buffer.log(TAG, INFO, { str1 = key @@ -71,6 +80,30 @@ class NotifCollectionLogger @Inject constructor( }) } + fun logChildDismissed(entry: NotificationEntry) { + buffer.log(TAG, DEBUG, { + str1 = entry.key + }, { + "CHILD DISMISSED (inferred): $str1" + }) + } + + fun logDismissAll(userId: Int) { + buffer.log(TAG, INFO, { + int1 = userId + }, { + "DISMISS ALL notifications for user $int1" + }) + } + + fun logDismissOnAlreadyCanceledEntry(entry: NotificationEntry) { + buffer.log(TAG, DEBUG, { + str1 = entry.key + }, { + "Dismiss on $str1, which was already canceled. Trying to remove..." + }) + } + fun logNotifDismissedIntercepted(key: String) { buffer.log(TAG, INFO, { str1 = key