From 729919670f36ea3c8f202779e25bd3352bf191c8 Mon Sep 17 00:00:00 2001 From: Gustav Sennton Date: Mon, 28 Jan 2019 21:09:54 +0000 Subject: [PATCH] Log notification location when a notification action is clicked. Bug: 120767764 Test: press a smart action from notification shade, and one from a heads-up notification to ensure the correct notification locations are logged. Change-Id: I2fb10bec9c0c1da0807581a0337f8f6b1adc620e --- .../server/notification/NotificationManagerService.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/services/core/java/com/android/server/notification/NotificationManagerService.java b/services/core/java/com/android/server/notification/NotificationManagerService.java index de3f50ad8c2c4..a1eeb70148241 100644 --- a/services/core/java/com/android/server/notification/NotificationManagerService.java +++ b/services/core/java/com/android/server/notification/NotificationManagerService.java @@ -769,7 +769,10 @@ public class NotificationManagerService extends SystemService { action.isContextual() ? 1 : 0) .addTaggedData( MetricsEvent.NOTIFICATION_SMART_SUGGESTION_ASSISTANT_GENERATED, - generatedByAssistant ? 1 : 0)); + generatedByAssistant ? 1 : 0) + .addTaggedData(MetricsEvent.NOTIFICATION_LOCATION, + nv.location.toMetricsEventEnum())); + EventLogTags.writeNotificationActionClicked(key, actionIndex, r.getLifespanMs(now), r.getFreshnessMs(now), r.getExposureMs(now), nv.rank, nv.count);