From 48caeffe10ad9a7ce038fb4b3f94c632140e0a6a Mon Sep 17 00:00:00 2001 From: cketti Date: Mon, 21 Feb 2022 17:11:14 +0100 Subject: [PATCH 1/2] More logging when recreating a NotificationChannel --- .../java/com/fsck/k9/notification/NotificationChannelManager.kt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/core/src/main/java/com/fsck/k9/notification/NotificationChannelManager.kt b/app/core/src/main/java/com/fsck/k9/notification/NotificationChannelManager.kt index 1445bf8ea..55b123380 100644 --- a/app/core/src/main/java/com/fsck/k9/notification/NotificationChannelManager.kt +++ b/app/core/src/main/java/com/fsck/k9/notification/NotificationChannelManager.kt @@ -193,6 +193,8 @@ class NotificationChannelManager( } Timber.v("Recreating NotificationChannel(%s => %s)", oldChannelId, newChannelId) + Timber.v("Old NotificationChannel: %s", oldNotificationChannel) + Timber.v("New NotificationChannel: %s", newNotificationChannel) notificationManager.createNotificationChannel(newNotificationChannel) } From c0f8c43baa4e33bb834d9866ef10eb32145e3fca Mon Sep 17 00:00:00 2001 From: cketti Date: Mon, 21 Feb 2022 17:26:33 +0100 Subject: [PATCH 2/2] Add logging for summary notifications These are the notifications responsible for sound/vibration/light. --- .../k9/notification/SingleMessageNotificationCreator.kt | 8 ++++++++ .../fsck/k9/notification/SummaryNotificationCreator.kt | 2 ++ 2 files changed, 10 insertions(+) diff --git a/app/core/src/main/java/com/fsck/k9/notification/SingleMessageNotificationCreator.kt b/app/core/src/main/java/com/fsck/k9/notification/SingleMessageNotificationCreator.kt index 46635307a..45027ec82 100644 --- a/app/core/src/main/java/com/fsck/k9/notification/SingleMessageNotificationCreator.kt +++ b/app/core/src/main/java/com/fsck/k9/notification/SingleMessageNotificationCreator.kt @@ -5,6 +5,7 @@ import androidx.core.app.NotificationCompat import androidx.core.app.NotificationCompat.WearableExtender import androidx.core.app.NotificationManagerCompat import com.fsck.k9.notification.NotificationChannelManager.ChannelType +import timber.log.Timber import androidx.core.app.NotificationCompat.Builder as NotificationBuilder internal class SingleMessageNotificationCreator( @@ -44,6 +45,13 @@ internal class SingleMessageNotificationCreator( .setLockScreenNotification(baseNotificationData, singleNotificationData.addLockScreenNotification) .build() + if (isGroupSummary) { + Timber.v( + "Creating single summary notification (silent=%b): %s", + singleNotificationData.isSilent, + notification + ) + } notificationManager.notify(notificationId, notification) } diff --git a/app/core/src/main/java/com/fsck/k9/notification/SummaryNotificationCreator.kt b/app/core/src/main/java/com/fsck/k9/notification/SummaryNotificationCreator.kt index d6b85a3ae..bcd4f72b3 100644 --- a/app/core/src/main/java/com/fsck/k9/notification/SummaryNotificationCreator.kt +++ b/app/core/src/main/java/com/fsck/k9/notification/SummaryNotificationCreator.kt @@ -7,6 +7,7 @@ import androidx.core.app.NotificationManagerCompat import com.fsck.k9.Account import com.fsck.k9.notification.NotificationChannelManager.ChannelType import com.fsck.k9.notification.NotificationIds.getNewMailSummaryNotificationId +import timber.log.Timber import androidx.core.app.NotificationCompat.Builder as NotificationBuilder internal class SummaryNotificationCreator( @@ -73,6 +74,7 @@ internal class SummaryNotificationCreator( .setLockScreenNotification(baseNotificationData) .build() + Timber.v("Creating inbox-style summary notification (silent=%b): %s", notificationData.isSilent, notification) notificationManager.notify(notificationData.notificationId, notification) }