Loading packages/SystemUI/src/com/android/systemui/bubbles/BubbleController.java +6 −3 Original line number Diff line number Diff line Loading @@ -428,7 +428,7 @@ public class BubbleController { entry.key).canBubble(); boolean hasOverlayIntent = n.getNotification().getBubbleMetadata() != null && n.getNotification().getBubbleMetadata().getIntent() != null; return hasOverlayIntent && canChannelOverlay && canAppOverlay; return DEBUG_ENABLE_AUTO_BUBBLE && hasOverlayIntent && canChannelOverlay && canAppOverlay; } /** Loading @@ -438,7 +438,8 @@ public class BubbleController { * message-like notification. * </p> */ private boolean shouldAutoBubble(Context context, NotificationEntry entry) { @VisibleForTesting protected boolean shouldAutoBubble(Context context, NotificationEntry entry) { if (entry.isBubbleDismissed()) { return false; } Loading @@ -465,9 +466,11 @@ public class BubbleController { Class<? extends Notification.Style> 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) boolean shouldAutoBubble = (((isMessageType && hasRemoteInput) || isMessageStyle) && autoBubbleMessages) || (isImportantOngoing && autoBubbleOngoing) || autoBubbleAll; return DEBUG_ENABLE_AUTO_BUBBLE && shouldAutoBubble; } private static boolean shouldAutoBubbleMessages(Context context) { Loading packages/SystemUI/tests/src/com/android/systemui/bubbles/BubbleControllerTest.java +6 −0 Original line number Diff line number Diff line Loading @@ -36,6 +36,7 @@ import com.android.systemui.statusbar.NotificationTestHelper; import com.android.systemui.statusbar.notification.NotificationEntryListener; import com.android.systemui.statusbar.notification.NotificationEntryManager; import com.android.systemui.statusbar.notification.collection.NotificationData; import com.android.systemui.statusbar.notification.collection.NotificationEntry; import com.android.systemui.statusbar.notification.row.ExpandableNotificationRow; import com.android.systemui.statusbar.phone.DozeParameters; import com.android.systemui.statusbar.phone.StatusBarWindowController; Loading Loading @@ -189,5 +190,10 @@ public class BubbleControllerTest extends SysuiTestCase { StatusBarWindowController statusBarWindowController) { super(context, statusBarWindowController); } @Override public boolean shouldAutoBubble(Context c, NotificationEntry entry) { return entry.notification.getNotification().getBubbleMetadata() != null; } } } Loading
packages/SystemUI/src/com/android/systemui/bubbles/BubbleController.java +6 −3 Original line number Diff line number Diff line Loading @@ -428,7 +428,7 @@ public class BubbleController { entry.key).canBubble(); boolean hasOverlayIntent = n.getNotification().getBubbleMetadata() != null && n.getNotification().getBubbleMetadata().getIntent() != null; return hasOverlayIntent && canChannelOverlay && canAppOverlay; return DEBUG_ENABLE_AUTO_BUBBLE && hasOverlayIntent && canChannelOverlay && canAppOverlay; } /** Loading @@ -438,7 +438,8 @@ public class BubbleController { * message-like notification. * </p> */ private boolean shouldAutoBubble(Context context, NotificationEntry entry) { @VisibleForTesting protected boolean shouldAutoBubble(Context context, NotificationEntry entry) { if (entry.isBubbleDismissed()) { return false; } Loading @@ -465,9 +466,11 @@ public class BubbleController { Class<? extends Notification.Style> 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) boolean shouldAutoBubble = (((isMessageType && hasRemoteInput) || isMessageStyle) && autoBubbleMessages) || (isImportantOngoing && autoBubbleOngoing) || autoBubbleAll; return DEBUG_ENABLE_AUTO_BUBBLE && shouldAutoBubble; } private static boolean shouldAutoBubbleMessages(Context context) { Loading
packages/SystemUI/tests/src/com/android/systemui/bubbles/BubbleControllerTest.java +6 −0 Original line number Diff line number Diff line Loading @@ -36,6 +36,7 @@ import com.android.systemui.statusbar.NotificationTestHelper; import com.android.systemui.statusbar.notification.NotificationEntryListener; import com.android.systemui.statusbar.notification.NotificationEntryManager; import com.android.systemui.statusbar.notification.collection.NotificationData; import com.android.systemui.statusbar.notification.collection.NotificationEntry; import com.android.systemui.statusbar.notification.row.ExpandableNotificationRow; import com.android.systemui.statusbar.phone.DozeParameters; import com.android.systemui.statusbar.phone.StatusBarWindowController; Loading Loading @@ -189,5 +190,10 @@ public class BubbleControllerTest extends SysuiTestCase { StatusBarWindowController statusBarWindowController) { super(context, statusBarWindowController); } @Override public boolean shouldAutoBubble(Context c, NotificationEntry entry) { return entry.notification.getNotification().getBubbleMetadata() != null; } } }