Merge "Null check! Now with a test"

This commit is contained in:
TreeHugger Robot
2017-03-22 15:20:31 +00:00
committed by Android (Google) Code Review
2 changed files with 9 additions and 4 deletions

View File

@@ -684,11 +684,11 @@ 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();
}
LogMaker lm = getChannelLog(channel, pkg);
lm.setType(MetricsProto.MetricsEvent.TYPE_CLOSE);
MetricsLogger.action(lm);
updateConfig();
}
@Override

View File

@@ -726,6 +726,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 =