Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 2c10655d authored by Mady Mellor's avatar Mady Mellor
Browse files

Remove foreground requirement for applying suppress notif

- Some usecases the app might not be foreground, e.g. 'mark
  as read' via a notification

Fixes: 175739832
Test: atest NotificationManagerServiceTest NotificationManagerTest
Change-Id: I6ca68588f24c4f84b475569e4a8936a8e4736985
parent db3a0b49
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -6062,7 +6062,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);
        }
    }
+1 −2
Original line number Diff line number Diff line
@@ -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