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

Commit 1528d932 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Fix blocked notifications screen" into rvc-dev

parents 73bf0374 425504c2
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -84,6 +84,9 @@ public class AppStateNotificationBridge extends AppStateBaseBridge {
        for (AppEntry entry : apps) {
            NotificationsSentState stats =
                    map.get(getKey(UserHandle.getUserId(entry.info.uid), entry.info.packageName));
            if (stats == null) {
                stats = new NotificationsSentState();
            }
            calculateAvgSentCounts(stats);
            addBlockStatus(entry, stats);
            entry.extraInfo = stats;
+6 −1
Original line number Diff line number Diff line
@@ -211,7 +211,12 @@ public class AppStateNotificationBridgeTest {
        when(mSession.getAllApps()).thenReturn(apps);

        mBridge.loadAllExtraInfo();
        assertThat(apps.get(0).extraInfo).isNull();
        // extra info should exist and blocked status should be populated
        assertThat(apps.get(0).extraInfo).isNotNull();
        verify(mBackend).getNotificationsBanned(PKG1, 0);
        // but the recent/frequent counts should be 0 so they don't appear on those screens
        assertThat(((NotificationsSentState) apps.get(0).extraInfo).avgSentDaily).isEqualTo(0);
        assertThat(((NotificationsSentState) apps.get(0).extraInfo).lastSent).isEqualTo(0);
    }

    @Test