Fix invalid `equals` in NotificationChannels.channelExists

`DEFAULT_CHANNEL_ID` is a String, but `channel` is a NotificationChannel. Equals will therefore always return `false`. I think my fix (using `getId()`) is what was intended.
This commit is contained in:
Bas van Schaik 2019-01-30 16:06:15 +00:00 committed by Greyson Parrelli
parent d482c60a98
commit ba67796992
1 changed files with 1 additions and 1 deletions

View File

@ -517,7 +517,7 @@ public class NotificationChannels {
@TargetApi(26)
private static boolean channelExists(@Nullable NotificationChannel channel) {
return channel != null && !NotificationChannel.DEFAULT_CHANNEL_ID.equals(channel);
return channel != null && !NotificationChannel.DEFAULT_CHANNEL_ID.equals(channel.getId());
}
private interface ChannelUpdater {