diff options
| author | 2018-08-09 14:58:52 -0700 | |
|---|---|---|
| committer | 2018-08-09 14:58:52 -0700 | |
| commit | b0f563c68b1425a1543b42053498e69d6df4e6bf (patch) | |
| tree | ba07b2b9737127f3098ac704b2472be2921ed38c | |
| parent | 1e15f2e30bf36b63d3e06dac7abb6df385bf5685 (diff) | |
| parent | 4db243a3db0879bb9734e6e3dea1fd661c8074b9 (diff) | |
Add a logging for ACTION_BAN_APP_NOTES
am: 4db243a3db
Change-Id: Idf6c0df5bb7a843394d14b5e4ad6ba0092bbc1d8
| -rw-r--r-- | proto/src/metrics_constants.proto | 5 | ||||
| -rw-r--r-- | services/core/java/com/android/server/notification/NotificationManagerService.java | 4 |
2 files changed, 7 insertions, 2 deletions
diff --git a/proto/src/metrics_constants.proto b/proto/src/metrics_constants.proto index 143fa8634333..835f93590558 100644 --- a/proto/src/metrics_constants.proto +++ b/proto/src/metrics_constants.proto @@ -941,9 +941,10 @@ message MetricsEvent { // OS: 6.0 NOTIFICATION_ZEN_MODE_EVENT_RULE = 146; - // ACTION: App notification settings > Block Notifications + // ACTION: App notification settings > Block Notifications or long press on + // notification blocks. // CATEGORY: SETTINGS - // OS: 6.0 + // OS: 9.0 ACTION_BAN_APP_NOTES = 147; // ACTION: Notification shade > Dismiss all button diff --git a/services/core/java/com/android/server/notification/NotificationManagerService.java b/services/core/java/com/android/server/notification/NotificationManagerService.java index 1284468947c2..c6e71e53d595 100644 --- a/services/core/java/com/android/server/notification/NotificationManagerService.java +++ b/services/core/java/com/android/server/notification/NotificationManagerService.java @@ -2122,6 +2122,10 @@ public class NotificationManagerService extends SystemService { enforceSystemOrSystemUI("setNotificationsEnabledForPackage"); mRankingHelper.setEnabled(pkg, uid, enabled); + mMetricsLogger.write(new LogMaker(MetricsEvent.ACTION_BAN_APP_NOTES) + .setType(MetricsEvent.TYPE_ACTION) + .setPackageName(pkg) + .setSubtype(enabled ? 1 : 0)); // Now, cancel any outstanding notifications that are part of a just-disabled app if (!enabled) { cancelAllNotificationsInt(MY_UID, MY_PID, pkg, null, 0, 0, true, |