Merge "Null check! Now with a test"
This commit is contained in:
committed by
Android (Google) Code Review
commit
2c98e18ce5
@@ -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
|
||||
|
||||
@@ -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 =
|
||||
|
||||
Reference in New Issue
Block a user