Merge changes I98d775b7,I4f2ee780

* changes:
  Only bubble music / call notifications, not all ongoing
  Require category message when auto-bubbling messages
This commit is contained in:
Mady Mellor
2018-12-06 02:15:30 +00:00
committed by Android (Google) Code Review

View File

@@ -342,13 +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<? extends Notification.Style> style = n.getNotification().getNotificationStyle();
boolean isMessageType = Notification.MessagingStyle.class.equals(style)
|| Notification.CATEGORY_MESSAGE.equals(n.getNotification().category)
|| hasRemoteInput;
return (isMessageType && autoBubbleMessages)
|| (n.isOngoing() && autoBubbleOngoing)
boolean isMessageType = Notification.CATEGORY_MESSAGE.equals(n.getNotification().category);
boolean isMessageStyle = Notification.MessagingStyle.class.equals(style);
return (((isMessageType && hasRemoteInput) || isMessageStyle) && autoBubbleMessages)
|| (isImportantOngoing && autoBubbleOngoing)
|| autoBubbleAll;
}