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

Commit ee802131 authored by Alexander Roederer's avatar Alexander Roederer Committed by Android (Google) Code Review
Browse files

Merge "Add FLAG_ONLY_ALERT_ONCE to direct reply update" into main

parents cd4e2bb5 97299da0
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -11271,6 +11271,9 @@ public class NotificationManagerService extends SystemService {
            // Lifetime extended notifications don't need to alert on state change.
            record.setPostSilently(true);
            // We also set FLAG_ONLY_ALERT_ONCE to avoid the notification from HUN-ing again.
            record.getNotification().flags |= FLAG_ONLY_ALERT_ONCE;
            mHandler.post(new EnqueueNotificationRunnable(record.getUser().getIdentifier(),
                    record, isAppForeground,
                    mPostNotificationTrackerFactory.newTracker(null)));
+4 −0
Original line number Diff line number Diff line
@@ -5969,6 +5969,8 @@ public class NotificationManagerServiceTest extends UiServiceTestCase {
        assertThat(captor.getValue().getNotification().flags
                & FLAG_LIFETIME_EXTENDED_BY_DIRECT_REPLY).isEqualTo(
                FLAG_LIFETIME_EXTENDED_BY_DIRECT_REPLY);
        assertThat(captor.getValue().getNotification().flags
                & FLAG_ONLY_ALERT_ONCE).isEqualTo(FLAG_ONLY_ALERT_ONCE);
        assertThat(captor.getValue().shouldPostSilently()).isTrue();
    }
@@ -8798,6 +8800,8 @@ public class NotificationManagerServiceTest extends UiServiceTestCase {
        assertThat(captor.getValue().getNotification().flags
                & FLAG_LIFETIME_EXTENDED_BY_DIRECT_REPLY).isEqualTo(
                FLAG_LIFETIME_EXTENDED_BY_DIRECT_REPLY);
        assertThat(captor.getValue().getNotification().flags
                & FLAG_ONLY_ALERT_ONCE).isEqualTo(FLAG_ONLY_ALERT_ONCE);
        assertThat(captor.getValue().shouldPostSilently()).isTrue();
    }