Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b64cb88c authored by Daniel Sandler's avatar Daniel Sandler
Browse files

Expanding NotificationManager's event logging.

Specifically, add the "tag" and "mustNotHaveFlags" columns.

(Hunting bug 5444859.)

Change-Id: Ic9ece44ed4697f7a8ef54e7870f72c9f94518cd9
parent bb1e7d43
Loading
Loading
Loading
Loading
+3 −3
Original line number Original line Diff line number Diff line
@@ -50,12 +50,12 @@ option java_package com.android.server
# NotificationManagerService.java
# NotificationManagerService.java
# ---------------------------
# ---------------------------
# when a NotificationManager.notify is called
# when a NotificationManager.notify is called
2750 notification_enqueue (pkg|3),(id|1|5),(notification|3)
2750 notification_enqueue (pkg|3),(id|1|5),(tag|3),(notification|3)
# when someone tries to cancel a notification, the notification manager sometimes
# when someone tries to cancel a notification, the notification manager sometimes
# calls this with flags too
# calls this with flags too
2751 notification_cancel (pkg|3),(id|1|5),(required_flags|1)
2751 notification_cancel (pkg|3),(id|1|5),(tag|3),(required_flags|1),(forbidden_flags|1)
# when someone tries to cancel all of the notifications for a particular package
# when someone tries to cancel all of the notifications for a particular package
2752 notification_cancel_all (pkg|3),(required_flags|1)
2752 notification_cancel_all (pkg|3),(required_flags|1),(forbidden_flags|1)




# ---------------------------
# ---------------------------
+6 −3
Original line number Original line Diff line number Diff line
@@ -707,7 +707,8 @@ public class NotificationManagerService extends INotificationManager.Stub
        //     behalf of the download manager without affecting other apps.
        //     behalf of the download manager without affecting other apps.
        if (!pkg.equals("com.android.providers.downloads")
        if (!pkg.equals("com.android.providers.downloads")
                || Log.isLoggable("DownloadManager", Log.VERBOSE)) {
                || Log.isLoggable("DownloadManager", Log.VERBOSE)) {
            EventLog.writeEvent(EventLogTags.NOTIFICATION_ENQUEUE, pkg, id, notification.toString());
            EventLog.writeEvent(EventLogTags.NOTIFICATION_ENQUEUE, pkg, id, tag,
                    notification.toString());
        }
        }


        if (pkg == null || notification == null) {
        if (pkg == null || notification == null) {
@@ -944,7 +945,8 @@ public class NotificationManagerService extends INotificationManager.Stub
     */
     */
    private void cancelNotification(String pkg, String tag, int id, int mustHaveFlags,
    private void cancelNotification(String pkg, String tag, int id, int mustHaveFlags,
            int mustNotHaveFlags, boolean sendDelete) {
            int mustNotHaveFlags, boolean sendDelete) {
        EventLog.writeEvent(EventLogTags.NOTIFICATION_CANCEL, pkg, id, mustHaveFlags);
        EventLog.writeEvent(EventLogTags.NOTIFICATION_CANCEL, pkg, id, tag,
                mustHaveFlags, mustNotHaveFlags);


        synchronized (mNotificationList) {
        synchronized (mNotificationList) {
            int index = indexOfNotificationLocked(pkg, tag, id);
            int index = indexOfNotificationLocked(pkg, tag, id);
@@ -972,7 +974,8 @@ public class NotificationManagerService extends INotificationManager.Stub
     */
     */
    boolean cancelAllNotificationsInt(String pkg, int mustHaveFlags,
    boolean cancelAllNotificationsInt(String pkg, int mustHaveFlags,
            int mustNotHaveFlags, boolean doit) {
            int mustNotHaveFlags, boolean doit) {
        EventLog.writeEvent(EventLogTags.NOTIFICATION_CANCEL_ALL, pkg, mustHaveFlags);
        EventLog.writeEvent(EventLogTags.NOTIFICATION_CANCEL_ALL, pkg, mustHaveFlags,
                mustNotHaveFlags);


        synchronized (mNotificationList) {
        synchronized (mNotificationList) {
            final int N = mNotificationList.size();
            final int N = mNotificationList.size();