Skip to content
Snippets Groups Projects
Commit aea29ed3 authored by Eyal Posener's avatar Eyal Posener Committed by Will Brockman
Browse files

[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
parent 66a23d05
No related branches found
No related tags found
No related merge requests found
......@@ -165,8 +165,7 @@ public class NotificationBlockingHelperManager {
private LogMaker getLogMaker() {
return mBlockingHelperRow.getStatusBarNotification()
.getLogMaker()
.setCategory(MetricsEvent.NOTIFICATION_ITEM)
.setType(MetricsEvent.NOTIFICATION_BLOCKING_HELPER);
.setCategory(MetricsEvent.NOTIFICATION_BLOCKING_HELPER);
}
// Format must stay in sync with frameworks/base/core/res/res/values/config.xml
......
......@@ -126,14 +126,17 @@ public class NotificationInfo extends LinearLayout implements NotificationGuts.G
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 @@ public class NotificationInfo extends LinearLayout implements NotificationGuts.G
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 @@ public class NotificationInfo extends LinearLayout implements NotificationGuts.G
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 @@ public class NotificationInfo extends LinearLayout implements NotificationGuts.G
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 @@ public class NotificationInfo extends LinearLayout implements NotificationGuts.G
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 @@ public class NotificationInfo extends LinearLayout implements NotificationGuts.G
}
private LogMaker getLogMaker() {
return mSbn.getLogMaker().setCategory(MetricsEvent.NOTIFICATION_ITEM);
return mSbn.getLogMaker();
}
}
......@@ -504,7 +504,8 @@ public class NotificationInfoTest extends SysuiTestCase {
IMPORTANCE_DEFAULT, true);
mNotificationInfo.logBlockingHelperCounter("HowCanNotifsBeRealIfAppsArent");
verify(mMetricsLogger).write(argThat(logMaker ->
logMaker.getType() == MetricsEvent.NOTIFICATION_BLOCKING_HELPER
logMaker.getCategory() == MetricsEvent.NOTIFICATION_BLOCKING_HELPER
&& logMaker.getType() == MetricsEvent.TYPE_OPEN
&& logMaker.getSubtype() == MetricsEvent.BLOCKING_HELPER_DISPLAY
));
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment