Skip to content

Commit b64cb88

Browse files
committed
Expanding NotificationManager's event logging.
Specifically, add the "tag" and "mustNotHaveFlags" columns. (Hunting bug 5444859.) Change-Id: Ic9ece44ed4697f7a8ef54e7870f72c9f94518cd9
1 parent bb1e7d4 commit b64cb88

File tree

2 files changed

+9
-6
lines changed

2 files changed

+9
-6
lines changed

services/java/com/android/server/EventLogTags.logtags

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,12 +50,12 @@ option java_package com.android.server
5050
# NotificationManagerService.java
5151
# ---------------------------
5252
# when a NotificationManager.notify is called
53-
2750 notification_enqueue (pkg|3),(id|1|5),(notification|3)
53+
2750 notification_enqueue (pkg|3),(id|1|5),(tag|3),(notification|3)
5454
# when someone tries to cancel a notification, the notification manager sometimes
5555
# calls this with flags too
56-
2751 notification_cancel (pkg|3),(id|1|5),(required_flags|1)
56+
2751 notification_cancel (pkg|3),(id|1|5),(tag|3),(required_flags|1),(forbidden_flags|1)
5757
# when someone tries to cancel all of the notifications for a particular package
58-
2752 notification_cancel_all (pkg|3),(required_flags|1)
58+
2752 notification_cancel_all (pkg|3),(required_flags|1),(forbidden_flags|1)
5959

6060

6161
# ---------------------------

services/java/com/android/server/NotificationManagerService.java

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -707,7 +707,8 @@ public void enqueueNotificationInternal(String pkg, int callingUid, int callingP
707707
// behalf of the download manager without affecting other apps.
708708
if (!pkg.equals("com.android.providers.downloads")
709709
|| Log.isLoggable("DownloadManager", Log.VERBOSE)) {
710-
EventLog.writeEvent(EventLogTags.NOTIFICATION_ENQUEUE, pkg, id, notification.toString());
710+
EventLog.writeEvent(EventLogTags.NOTIFICATION_ENQUEUE, pkg, id, tag,
711+
notification.toString());
711712
}
712713

713714
if (pkg == null || notification == null) {
@@ -944,7 +945,8 @@ private void cancelNotificationLocked(NotificationRecord r, boolean sendDelete)
944945
*/
945946
private void cancelNotification(String pkg, String tag, int id, int mustHaveFlags,
946947
int mustNotHaveFlags, boolean sendDelete) {
947-
EventLog.writeEvent(EventLogTags.NOTIFICATION_CANCEL, pkg, id, mustHaveFlags);
948+
EventLog.writeEvent(EventLogTags.NOTIFICATION_CANCEL, pkg, id, tag,
949+
mustHaveFlags, mustNotHaveFlags);
948950

949951
synchronized (mNotificationList) {
950952
int index = indexOfNotificationLocked(pkg, tag, id);
@@ -972,7 +974,8 @@ private void cancelNotification(String pkg, String tag, int id, int mustHaveFlag
972974
*/
973975
boolean cancelAllNotificationsInt(String pkg, int mustHaveFlags,
974976
int mustNotHaveFlags, boolean doit) {
975-
EventLog.writeEvent(EventLogTags.NOTIFICATION_CANCEL_ALL, pkg, mustHaveFlags);
977+
EventLog.writeEvent(EventLogTags.NOTIFICATION_CANCEL_ALL, pkg, mustHaveFlags,
978+
mustNotHaveFlags);
976979

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

0 commit comments

Comments
 (0)