From d026e1093c2794077243c75c7325bf49e313c0a1 Mon Sep 17 00:00:00 2001 From: Lucas Dupin Date: Thu, 2 Dec 2021 18:04:25 -0800 Subject: [PATCH] Add trace tags for notifications So we can see on traces how many are visible, and how many we're holding onto. Test: perfetto trace Bug: 208508265 Change-Id: I9ac5b33dd334fa33ce7976a2020bafe4a1f58914 --- .../statusbar/notification/logging/NotificationLogger.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/logging/NotificationLogger.java b/packages/SystemUI/src/com/android/systemui/statusbar/notification/logging/NotificationLogger.java index 4441270f895b0..fa9217d831f1b 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/logging/NotificationLogger.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/logging/NotificationLogger.java @@ -20,6 +20,7 @@ import android.os.Handler; import android.os.RemoteException; import android.os.ServiceManager; import android.os.SystemClock; +import android.os.Trace; import android.service.notification.NotificationListenerService; import android.service.notification.StatusBarNotification; import android.util.ArrayMap; @@ -158,6 +159,9 @@ public class NotificationLogger implements StateListener { mExpansionStateLogger.onVisibilityChanged( mTmpCurrentlyVisibleNotifications, mTmpCurrentlyVisibleNotifications); + Trace.traceCounter(Trace.TRACE_TAG_APP, "Notifications [Active]", N); + Trace.traceCounter(Trace.TRACE_TAG_APP, "Notifications [Visible]", + mCurrentlyVisibleNotifications.size()); recycleAllVisibilityObjects(mTmpNoLongerVisibleNotifications); mTmpCurrentlyVisibleNotifications.clear();