summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Jeff DeCew <jeffdq@google.com> 2025-02-14 20:11:19 -0800
committer Android (Google) Code Review <android-gerrit@google.com> 2025-02-14 20:11:19 -0800
commit8ee8ffb784febef6cc161b0bddddfb9916a9afd0 (patch)
treef96fcdc1e3a9500afcd897ae095430a55ff4a4d6
parent7a77ed95d4e9a0fe40d9cf45e5ce2c9ebd2379e8 (diff)
parenta6eab69222995ca3e604e3020304c2ea9c964ef9 (diff)
Merge "Add RON metrics to notification reported atom" into main
-rw-r--r--services/core/java/com/android/server/notification/NotificationRecordLogger.java25
-rw-r--r--services/core/java/com/android/server/notification/NotificationRecordLoggerImpl.java4
2 files changed, 15 insertions, 14 deletions
diff --git a/services/core/java/com/android/server/notification/NotificationRecordLogger.java b/services/core/java/com/android/server/notification/NotificationRecordLogger.java
index 6c0035b82a86..f680ce722e81 100644
--- a/services/core/java/com/android/server/notification/NotificationRecordLogger.java
+++ b/services/core/java/com/android/server/notification/NotificationRecordLogger.java
@@ -514,11 +514,14 @@ interface NotificationRecordLogger {
final int fsi_state;
final boolean is_locked;
final int age_in_minutes;
+ final boolean is_promoted_ongoing;
+ final boolean has_promotable_characteristics;
@DurationMillisLong long post_duration_millis; // Not final; calculated at the end.
NotificationReported(NotificationRecordPair p,
NotificationReportedEvent eventType, int position, int buzzBeepBlink,
InstanceId groupId) {
+ final Notification notification = p.r.getSbn().getNotification();
this.event_id = eventType.getId();
this.uid = p.r.getUid();
this.package_name = p.r.getSbn().getPackageName();
@@ -527,8 +530,8 @@ interface NotificationRecordLogger {
this.channel_id_hash = p.getChannelIdHash();
this.group_id_hash = p.getGroupIdHash();
this.group_instance_id = (groupId == null) ? 0 : groupId.getId();
- this.is_group_summary = p.r.getSbn().getNotification().isGroupSummary();
- this.category = p.r.getSbn().getNotification().category;
+ this.is_group_summary = notification.isGroupSummary();
+ this.category = notification.category;
this.style = p.getStyle();
this.num_people = p.getNumPeople();
this.position = position;
@@ -542,22 +545,18 @@ interface NotificationRecordLogger {
this.assistant_ranking_score = p.r.getRankingScore();
this.is_ongoing = p.r.getSbn().isOngoing();
this.is_foreground_service = NotificationRecordLogger.isForegroundService(p.r);
- this.timeout_millis = p.r.getSbn().getNotification().getTimeoutAfter();
+ this.timeout_millis = notification.getTimeoutAfter();
this.is_non_dismissible = NotificationRecordLogger.isNonDismissible(p.r);
-
- final boolean hasFullScreenIntent =
- p.r.getSbn().getNotification().fullScreenIntent != null;
-
- final boolean hasFsiRequestedButDeniedFlag = (p.r.getSbn().getNotification().flags
- & Notification.FLAG_FSI_REQUESTED_BUT_DENIED) != 0;
-
+ final boolean hasFullScreenIntent = notification.fullScreenIntent != null;
+ final boolean hasFsiRequestedButDeniedFlag =
+ (notification.flags & Notification.FLAG_FSI_REQUESTED_BUT_DENIED) != 0;
this.fsi_state = NotificationRecordLogger.getFsiState(
hasFullScreenIntent, hasFsiRequestedButDeniedFlag, eventType);
-
this.is_locked = p.r.isLocked();
-
this.age_in_minutes = NotificationRecordLogger.getAgeInMinutes(
- p.r.getSbn().getPostTime(), p.r.getSbn().getNotification().getWhen());
+ p.r.getSbn().getPostTime(), notification.getWhen());
+ this.is_promoted_ongoing = notification.isPromotedOngoing();
+ this.has_promotable_characteristics = notification.hasPromotableCharacteristics();
}
}
diff --git a/services/core/java/com/android/server/notification/NotificationRecordLoggerImpl.java b/services/core/java/com/android/server/notification/NotificationRecordLoggerImpl.java
index fc0a7764963e..e0e3fbaf49f1 100644
--- a/services/core/java/com/android/server/notification/NotificationRecordLoggerImpl.java
+++ b/services/core/java/com/android/server/notification/NotificationRecordLoggerImpl.java
@@ -78,7 +78,9 @@ class NotificationRecordLoggerImpl implements NotificationRecordLogger {
notificationReported.post_duration_millis,
notificationReported.fsi_state,
notificationReported.is_locked,
- notificationReported.age_in_minutes);
+ notificationReported.age_in_minutes,
+ notificationReported.is_promoted_ongoing,
+ notificationReported.has_promotable_characteristics);
}
@Override