From b1ebc3b7a013a647dd4a3c6f006e00a017886b20 Mon Sep 17 00:00:00 2001 From: Julia Reynolds Date: Fri, 15 Apr 2016 15:12:36 -0400 Subject: [PATCH 1/2] Logging for ranker bundling. Bug: 28210646 Change-Id: I90d1adaf23d318e07b1a9941ac45b5d6ae0624e8 --- .../core/java/com/android/server/EventLogTags.logtags | 4 ++++ .../notification/NotificationManagerService.java | 10 ++++++++-- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/services/core/java/com/android/server/EventLogTags.logtags b/services/core/java/com/android/server/EventLogTags.logtags index c59ecec725cd9..74ff41c138023 100644 --- a/services/core/java/com/android/server/EventLogTags.logtags +++ b/services/core/java/com/android/server/EventLogTags.logtags @@ -80,6 +80,10 @@ option java_package com.android.server 27531 notification_visibility (key|3),(visibile|1),(lifespan|1),(freshness|1),(exposure|1),(rank|1) # a notification emited noise, vibration, or light 27532 notification_alert (key|3),(buzz|1),(beep|1),(blink|1) +# a notification was added to a autogroup +27533 notification_autogrouped (key|3) +# notification was removed from an autogroup +275534 notification_unautogrouped (key|3) # --------------------------- # Watchdog.java diff --git a/services/core/java/com/android/server/notification/NotificationManagerService.java b/services/core/java/com/android/server/notification/NotificationManagerService.java index cabdced361f90..b3d6fd4a34a7a 100644 --- a/services/core/java/com/android/server/notification/NotificationManagerService.java +++ b/services/core/java/com/android/server/notification/NotificationManagerService.java @@ -2179,8 +2179,14 @@ public class NotificationManagerService extends SystemService { } if (adjustment.getSignals() != null) { Bundle.setDefusable(adjustment.getSignals(), true); - n.sbn.setOverrideGroupKey(adjustment.getSignals().getString( - Adjustment.GROUP_KEY_OVERRIDE_KEY, null)); + final String autoGroupKey = adjustment.getSignals().getString( + Adjustment.GROUP_KEY_OVERRIDE_KEY, null); + if (autoGroupKey == null) { + EventLogTags.writeNotificationUnautogrouped(adjustment.getKey()); + } else { + EventLogTags.writeNotificationAutogrouped(adjustment.getKey()); + } + n.sbn.setOverrideGroupKey(autoGroupKey); } } From 5bba3e7cd39e1acd4c3190f962f258ad3378b4e1 Mon Sep 17 00:00:00 2001 From: Julia Reynolds Date: Fri, 15 Apr 2016 15:13:54 -0400 Subject: [PATCH 2/2] Add content intent to autogroup summary. Change-Id: I01afb5e9aa7d74844d6640fdc70b39b59ef2093a Fixes: 28194709 --- .../server/notification/NotificationManagerService.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/services/core/java/com/android/server/notification/NotificationManagerService.java b/services/core/java/com/android/server/notification/NotificationManagerService.java index b3d6fd4a34a7a..e411579dbf84b 100644 --- a/services/core/java/com/android/server/notification/NotificationManagerService.java +++ b/services/core/java/com/android/server/notification/NotificationManagerService.java @@ -2239,6 +2239,13 @@ public class NotificationManagerService extends SystemService { .setFlag(Notification.FLAG_GROUP_SUMMARY, true) .build(); summaryNotification.extras.putAll(extras); + Intent appIntent = getContext().getPackageManager() + .getLaunchIntentForPackage(adjustment.getPackage()); + if (appIntent != null) { + summaryNotification.contentIntent = PendingIntent.getActivityAsUser( + getContext(), 0, appIntent, 0, null, + UserHandle.of(adjustedSbn.getUserId())); + } final StatusBarNotification summarySbn = new StatusBarNotification(adjustedSbn.getPackageName(), adjustedSbn.getOpPkg(),