From e3175370f99919dab91d161c80c1c02cfea0a127 Mon Sep 17 00:00:00 2001 From: Mady Mellor Date: Tue, 4 Dec 2018 17:05:11 -0800 Subject: [PATCH 1/2] Require category message when auto-bubbling messages Test: manual Bug: 111236845 Change-Id: I4f2ee780aff5fadcc494ca8abf7966ee34f24803 --- .../src/com/android/systemui/bubbles/BubbleController.java | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/packages/SystemUI/src/com/android/systemui/bubbles/BubbleController.java b/packages/SystemUI/src/com/android/systemui/bubbles/BubbleController.java index 416cc594051b8..c64f3da84becb 100644 --- a/packages/SystemUI/src/com/android/systemui/bubbles/BubbleController.java +++ b/packages/SystemUI/src/com/android/systemui/bubbles/BubbleController.java @@ -344,10 +344,9 @@ public class BubbleController { } Class style = n.getNotification().getNotificationStyle(); - boolean isMessageType = Notification.MessagingStyle.class.equals(style) - || Notification.CATEGORY_MESSAGE.equals(n.getNotification().category) - || hasRemoteInput; - return (isMessageType && autoBubbleMessages) + boolean isMessageType = Notification.CATEGORY_MESSAGE.equals(n.getNotification().category); + boolean isMessageStyle = Notification.MessagingStyle.class.equals(style); + return (((isMessageType && hasRemoteInput) || isMessageStyle) && autoBubbleMessages) || (n.isOngoing() && autoBubbleOngoing) || autoBubbleAll; } From 711f9561e5d733e8711952566ffc5267db4550d9 Mon Sep 17 00:00:00 2001 From: Mady Mellor Date: Wed, 5 Dec 2018 14:53:46 -0800 Subject: [PATCH 2/2] Only bubble music / call notifications, not all ongoing Test: manual Bug: 111236845 Change-Id: I98d775b7a47f9a10e983f036af24bb814e56cd62 --- .../src/com/android/systemui/bubbles/BubbleController.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/SystemUI/src/com/android/systemui/bubbles/BubbleController.java b/packages/SystemUI/src/com/android/systemui/bubbles/BubbleController.java index c64f3da84becb..5c259d5c40938 100644 --- a/packages/SystemUI/src/com/android/systemui/bubbles/BubbleController.java +++ b/packages/SystemUI/src/com/android/systemui/bubbles/BubbleController.java @@ -342,12 +342,16 @@ public class BubbleController { } } } + boolean isCall = Notification.CATEGORY_CALL.equals(n.getNotification().category) + && n.isOngoing(); + boolean isMusic = n.getNotification().hasMediaSession(); + boolean isImportantOngoing = isMusic || isCall; Class style = n.getNotification().getNotificationStyle(); boolean isMessageType = Notification.CATEGORY_MESSAGE.equals(n.getNotification().category); boolean isMessageStyle = Notification.MessagingStyle.class.equals(style); return (((isMessageType && hasRemoteInput) || isMessageStyle) && autoBubbleMessages) - || (n.isOngoing() && autoBubbleOngoing) + || (isImportantOngoing && autoBubbleOngoing) || autoBubbleAll; }