Switch logic order for detecting conversation channel changes.
This commit is contained in:
parent
4af078007e
commit
f4dd80c929
1 changed files with 6 additions and 6 deletions
|
@ -550,12 +550,9 @@ public class NotificationChannels {
|
|||
Set<String> existingChannelIds = Stream.of(notificationManager.getNotificationChannels()).map(NotificationChannel::getId).collect(Collectors.toSet());
|
||||
|
||||
for (NotificationChannel existingChannel : notificationManager.getNotificationChannels()) {
|
||||
if (existingChannel.getId().startsWith(CONTACT_PREFIX) && !customChannelIds.contains(existingChannel.getId())) {
|
||||
Log.i(TAG, "Consistency: Deleting channel '"+ existingChannel.getId() + "' because the DB has no record of it.");
|
||||
notificationManager.deleteNotificationChannel(existingChannel.getId());
|
||||
} else if (existingChannel.getId().startsWith(MESSAGES_PREFIX) &&
|
||||
Build.VERSION.SDK_INT >= CONVERSATION_SUPPORT_VERSION &&
|
||||
existingChannel.getConversationId() != null)
|
||||
if ((existingChannel.getId().startsWith(CONTACT_PREFIX) || existingChannel.getId().startsWith(MESSAGES_PREFIX)) &&
|
||||
Build.VERSION.SDK_INT >= CONVERSATION_SUPPORT_VERSION &&
|
||||
existingChannel.getConversationId() != null)
|
||||
{
|
||||
if (customChannelIds.contains(existingChannel.getId())) {
|
||||
continue;
|
||||
|
@ -569,6 +566,9 @@ public class NotificationChannels {
|
|||
Log.i(TAG, "Consistency: Conversation channel created outside of app with no matching recipient, deleting channel '" + existingChannel.getId() + "'");
|
||||
notificationManager.deleteNotificationChannel(existingChannel.getId());
|
||||
}
|
||||
} else if (existingChannel.getId().startsWith(CONTACT_PREFIX) && !customChannelIds.contains(existingChannel.getId())) {
|
||||
Log.i(TAG, "Consistency: Deleting channel '"+ existingChannel.getId() + "' because the DB has no record of it.");
|
||||
notificationManager.deleteNotificationChannel(existingChannel.getId());
|
||||
} else if (existingChannel.getId().startsWith(MESSAGES_PREFIX) && !existingChannel.getId().equals(getMessagesChannel(context))) {
|
||||
Log.i(TAG, "Consistency: Deleting channel '" + existingChannel.getId() + "' because it's out of date.");
|
||||
notificationManager.deleteNotificationChannel(existingChannel.getId());
|
||||
|
|
Loading…
Add table
Reference in a new issue