From ba67796992654ea113c5d2decafd51413ae4a768 Mon Sep 17 00:00:00 2001 From: Bas van Schaik <5082246+sjvs@users.noreply.github.com> Date: Wed, 30 Jan 2019 16:06:15 +0000 Subject: [PATCH] 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. --- .../securesms/notifications/NotificationChannels.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/org/thoughtcrime/securesms/notifications/NotificationChannels.java b/src/org/thoughtcrime/securesms/notifications/NotificationChannels.java index 2e43329565..628b6ba776 100644 --- a/src/org/thoughtcrime/securesms/notifications/NotificationChannels.java +++ b/src/org/thoughtcrime/securesms/notifications/NotificationChannels.java @@ -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 {