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

Commit 8e0eb372 authored by Julia Reynolds's avatar Julia Reynolds
Browse files

Null check! Now with a test

Test: runtest systemui-notification
Change-Id: I0b98b3dd6aeaa7e300bba98b7d7f7f5afae16596
Fixes: 36245468
parent 48926cc1
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -683,12 +683,12 @@ public class RankingHelper implements RankingConfig {
        NotificationChannel channel = r.channels.get(channelId);
        if (channel != null) {
            channel.setDeleted(true);
        }
            LogMaker lm = getChannelLog(channel, pkg);
            lm.setType(MetricsProto.MetricsEvent.TYPE_CLOSE);
            MetricsLogger.action(lm);
            updateConfig();
        }
    }

    @Override
    @VisibleForTesting
+5 −0
Original line number Diff line number Diff line
@@ -724,6 +724,11 @@ public class RankingHelperTest {
        assertEquals(channel.canShowBadge(), savedChannel.canShowBadge());
    }

    @Test
    public void testDeleteNonExistentChannel() throws Exception {
        mHelper.deleteNotificationChannelGroup(PKG, UID, "does not exist");
    }

    @Test
    public void testGetDeletedChannel() throws Exception {
        NotificationChannel channel =