Merge "Remove foreground requirement for applying suppress notif"

This commit is contained in:
Mady Mellor
2021-01-14 19:38:09 +00:00
committed by Android (Google) Code Review
2 changed files with 1 additions and 3 deletions

View File

@@ -6078,7 +6078,6 @@ public class NotificationManagerService extends SystemService {
if (!isAppForeground && metadata != null) {
int flags = metadata.getFlags();
flags &= ~Notification.BubbleMetadata.FLAG_AUTO_EXPAND_BUBBLE;
flags &= ~Notification.BubbleMetadata.FLAG_SUPPRESS_NOTIFICATION;
metadata.setFlags(flags);
}
}

View File

@@ -6531,9 +6531,8 @@ public class NotificationManagerServiceTest extends UiServiceTestCase {
Notification notif = mService.getNotificationRecord(nr.getSbn().getKey()).getNotification();
assertTrue(notif.isBubbleNotification());
// Our flags should have failed since we're not foreground
// The flag should have failed since we're not foreground
assertFalse(notif.getBubbleMetadata().getAutoExpandBubble());
assertFalse(notif.getBubbleMetadata().isNotificationSuppressed());
}
@Test