[Blocking Helper logs] Modify blocking helper to category
Remove MetricsEvent.NOTIFICATION_ITEM from log category,
and use the NOTIFICATION_BLOCKING_HELPER constant as the log
category.
Bug: 112482290
Test: atest SystemUITests and manual testing.
Change-Id: I8a119f625c81df2bbdd30fc9f3e4d3a2ad478ac2
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/NotificationInfo.java b/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/NotificationInfo.java
index 2a9a815..359bc6e 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/NotificationInfo.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/NotificationInfo.java
@@ -126,14 +126,17 @@
private OnClickListener mOnKeepShowing = v -> {
mExitReason = NotificationCounters.BLOCKING_HELPER_KEEP_SHOWING;
closeControls(v);
- mMetricsLogger.write(getLogMaker().setType(MetricsEvent.NOTIFICATION_BLOCKING_HELPER)
+ mMetricsLogger.write(getLogMaker().setCategory(MetricsEvent.NOTIFICATION_BLOCKING_HELPER)
+ .setType(MetricsEvent.TYPE_ACTION)
.setSubtype(MetricsEvent.BLOCKING_HELPER_CLICK_STAY_SILENT));
};
private OnClickListener mOnToggleSilent = v -> {
Runnable saveImportance = () -> {
swapContent(ACTION_TOGGLE_SILENT, true /* animate */);
- mMetricsLogger.write(getLogMaker().setType(MetricsEvent.NOTIFICATION_BLOCKING_HELPER)
+ mMetricsLogger.write(getLogMaker()
+ .setCategory(MetricsEvent.NOTIFICATION_BLOCKING_HELPER)
+ .setType(MetricsEvent.TYPE_ACTION)
.setSubtype(MetricsEvent.BLOCKING_HELPER_CLICK_ALERT_ME));
};
if (mCheckSaveListener != null) {
@@ -146,7 +149,9 @@
private OnClickListener mOnStopOrMinimizeNotifications = v -> {
Runnable saveImportance = () -> {
swapContent(ACTION_BLOCK, true /* animate */);
- mMetricsLogger.write(getLogMaker().setType(MetricsEvent.NOTIFICATION_BLOCKING_HELPER)
+ mMetricsLogger.write(getLogMaker()
+ .setCategory(MetricsEvent.NOTIFICATION_BLOCKING_HELPER)
+ .setType(MetricsEvent.TYPE_ACTION)
.setSubtype(MetricsEvent.BLOCKING_HELPER_CLICK_BLOCKED));
};
if (mCheckSaveListener != null) {
@@ -162,7 +167,8 @@
logBlockingHelperCounter(NotificationCounters.BLOCKING_HELPER_UNDO);
mMetricsLogger.write(importanceChangeLogMaker().setType(MetricsEvent.TYPE_DISMISS));
swapContent(ACTION_UNDO, true /* animate */);
- mMetricsLogger.write(getLogMaker().setType(MetricsEvent.NOTIFICATION_BLOCKING_HELPER)
+ mMetricsLogger.write(getLogMaker().setCategory(MetricsEvent.NOTIFICATION_BLOCKING_HELPER)
+ .setType(MetricsEvent.TYPE_DISMISS)
.setSubtype(MetricsEvent.BLOCKING_HELPER_CLICK_UNDO));
};
@@ -263,7 +269,8 @@
bindPrompt();
bindButtons();
- mMetricsLogger.write(getLogMaker().setType(MetricsEvent.NOTIFICATION_BLOCKING_HELPER)
+ mMetricsLogger.write(getLogMaker().setCategory(MetricsEvent.NOTIFICATION_BLOCKING_HELPER)
+ .setType(MetricsEvent.TYPE_OPEN)
.setSubtype(MetricsEvent.BLOCKING_HELPER_DISPLAY));
}
@@ -609,8 +616,8 @@
confirmation.setAlpha(1f);
header.setVisibility(VISIBLE);
header.setAlpha(1f);
- mMetricsLogger.write(getLogMaker().setType(MetricsEvent.NOTIFICATION_BLOCKING_HELPER)
- .setSubtype(MetricsEvent.BLOCKING_HELPER_DISMISS));
+ mMetricsLogger.write(getLogMaker().setCategory(MetricsEvent.NOTIFICATION_BLOCKING_HELPER)
+ .setType(MetricsEvent.TYPE_CLOSE));
}
@Override
@@ -758,6 +765,6 @@
}
private LogMaker getLogMaker() {
- return mSbn.getLogMaker().setCategory(MetricsEvent.NOTIFICATION_ITEM);
+ return mSbn.getLogMaker();
}
}