summaryrefslogtreecommitdiff
path: root/core/java/android
diff options
context:
space:
mode:
authorWill Brockman <brockman@google.com>2019-01-28 09:55:45 -0500
committerWill Brockman <brockman@google.com>2019-01-28 10:32:18 -0500
commit828427ef5d3d71c9a1c920eddcda4486da460288 (patch)
tree290fbd73e33c7ab7d37e7b0b69653a23ee2595cb /core/java/android
parent170725ab67c42b024ce2f0f8f6c76b5d4f64cdcc (diff)
Add notification category information to notification logging.
Capturing the app-declared notification category: https://developer.android.com/training/notify-user/build-notification#system-category Adding to StatusBarNotification.getLogMaker() means that it will be put on many categories of notification logging automatically. No extra data usage for notifications where the category was not declared. Bug: 123071368 Test: atest SystemUITests and manual test Change-Id: I8f59fea1a8e7c98366fe888cf5a28cf252859fdf
Diffstat (limited to 'core/java/android')
-rw-r--r--core/java/android/service/notification/StatusBarNotification.java5
1 files changed, 4 insertions, 1 deletions
diff --git a/core/java/android/service/notification/StatusBarNotification.java b/core/java/android/service/notification/StatusBarNotification.java
index 3a644d4cd12a..551bb8ada044 100644
--- a/core/java/android/service/notification/StatusBarNotification.java
+++ b/core/java/android/service/notification/StatusBarNotification.java
@@ -28,6 +28,7 @@ import android.os.Parcel;
import android.os.Parcelable;
import android.os.UserHandle;
+import com.android.internal.logging.nano.MetricsProto;
import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
/**
@@ -410,7 +411,9 @@ public class StatusBarNotification implements Parcelable {
.clearSubtype()
.addTaggedData(MetricsEvent.FIELD_NOTIFICATION_GROUP_ID, getGroupLogTag())
.addTaggedData(MetricsEvent.FIELD_NOTIFICATION_GROUP_SUMMARY,
- getNotification().isGroupSummary() ? 1 : 0);
+ getNotification().isGroupSummary() ? 1 : 0)
+ .addTaggedData(MetricsProto.MetricsEvent.FIELD_NOTIFICATION_CATEGORY,
+ getNotification().category);
}
private String getGroupLogTag() {