Add a logging for ACTION_BAN_APP_NOTES

am: 4db243a3db

Change-Id: Idf6c0df5bb7a843394d14b5e4ad6ba0092bbc1d8
This commit is contained in:
Howard Ro
2018-08-09 14:58:52 -07:00
committed by android-build-merger
2 changed files with 7 additions and 2 deletions

View File

@@ -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

View File

@@ -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,