diff options
| author | 2017-09-15 11:11:24 +0000 | |
|---|---|---|
| committer | 2017-09-15 11:11:24 +0000 | |
| commit | 925c00b49d341db3acd724c20e5dc504794e235f (patch) | |
| tree | fc8f570ed97de6b83c2a692474105e6ff9f0ada3 | |
| parent | 06b47e2a9c08db9adfbafa1ecd5456158454fe5c (diff) | |
| parent | fc47cb305ce1604c0ca48e7db5cd1ab0f707af50 (diff) | |
Merge "Merge "also log user-initiated notification collapse events" into oc-mr1-dev am: e72e8b1528 am: bd4d6dede5"
| -rw-r--r-- | proto/src/metrics_constants.proto | 5 | ||||
| -rw-r--r-- | services/core/java/com/android/server/notification/NotificationManagerService.java | 5 |
2 files changed, 7 insertions, 3 deletions
diff --git a/proto/src/metrics_constants.proto b/proto/src/metrics_constants.proto index 2bdd73707777..035a1ebc3647 100644 --- a/proto/src/metrics_constants.proto +++ b/proto/src/metrics_constants.proto @@ -33,7 +33,7 @@ message MetricsEvent { // The view became hidden. TYPE_CLOSE = 2; - // The view switched to detail mode (most relevant for quick settings tiles) + // The view switched to detail mode (most relevant for quick settings tiles and notifications) TYPE_DETAIL = 3; // The view or control was activated. @@ -70,6 +70,9 @@ message MetricsEvent { // Type for APP_TRANSITION_REPORTED_DRAWN event: The activity was started with restoring from // a bundle. TYPE_TRANSITION_REPORTED_DRAWN_WITH_BUNDLE = 13; + + // The view switched to summary mode (most relevant for notifications) + TYPE_COLLAPSE = 14; } // Types of alerts, as bit field values diff --git a/services/core/java/com/android/server/notification/NotificationManagerService.java b/services/core/java/com/android/server/notification/NotificationManagerService.java index 0cca63b810e4..fe39fccbc781 100644 --- a/services/core/java/com/android/server/notification/NotificationManagerService.java +++ b/services/core/java/com/android/server/notification/NotificationManagerService.java @@ -755,10 +755,11 @@ public class NotificationManagerService extends SystemService { if (r != null) { r.stats.onExpansionChanged(userAction, expanded); final long now = System.currentTimeMillis(); - if (userAction && expanded) { + if (userAction) { MetricsLogger.action(r.getLogMaker(now) .setCategory(MetricsEvent.NOTIFICATION_ITEM) - .setType(MetricsEvent.TYPE_DETAIL)); + .setType(expanded ? MetricsEvent.TYPE_DETAIL + : MetricsEvent.TYPE_COLLAPSE)); } EventLogTags.writeNotificationExpansion(key, userAction ? 1 : 0, expanded ? 1 : 0, |