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

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

Merge "Post LifetimeExt updates silently" into main

parents 1848844b ba61dbdb
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -11924,6 +11924,9 @@ public class NotificationManagerService extends SystemService {
        if (record != null && (record.getSbn().getNotification().flags
                & FLAG_LIFETIME_EXTENDED_BY_DIRECT_REPLY) > 0) {
            boolean isAppForeground = pkg != null && packageImportance == IMPORTANCE_FOREGROUND;
            // Lifetime extended notifications don't need to alert on state change.
            record.setPostSilently(true);
            mHandler.post(new EnqueueNotificationRunnable(record.getUser().getIdentifier(),
                    record, isAppForeground,
                    mPostNotificationTrackerFactory.newTracker(null)));
+2 −0
Original line number Diff line number Diff line
@@ -5862,6 +5862,7 @@ 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().shouldPostSilently()).isTrue();
    }
    @Test
@@ -8603,6 +8604,7 @@ 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().shouldPostSilently()).isTrue();
    }
    @Test