Merge pull request #5928 from k9mail/more_notification_logging

Add more logging around notifications
This commit is contained in:
cketti 2022-02-22 17:59:21 +01:00 committed by GitHub
commit 3046312be6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 12 additions and 0 deletions

View file

@ -193,6 +193,8 @@ class NotificationChannelManager(
} }
Timber.v("Recreating NotificationChannel(%s => %s)", oldChannelId, newChannelId) Timber.v("Recreating NotificationChannel(%s => %s)", oldChannelId, newChannelId)
Timber.v("Old NotificationChannel: %s", oldNotificationChannel)
Timber.v("New NotificationChannel: %s", newNotificationChannel)
notificationManager.createNotificationChannel(newNotificationChannel) notificationManager.createNotificationChannel(newNotificationChannel)
} }

View file

@ -5,6 +5,7 @@ import androidx.core.app.NotificationCompat
import androidx.core.app.NotificationCompat.WearableExtender import androidx.core.app.NotificationCompat.WearableExtender
import androidx.core.app.NotificationManagerCompat import androidx.core.app.NotificationManagerCompat
import com.fsck.k9.notification.NotificationChannelManager.ChannelType import com.fsck.k9.notification.NotificationChannelManager.ChannelType
import timber.log.Timber
import androidx.core.app.NotificationCompat.Builder as NotificationBuilder import androidx.core.app.NotificationCompat.Builder as NotificationBuilder
internal class SingleMessageNotificationCreator( internal class SingleMessageNotificationCreator(
@ -44,6 +45,13 @@ internal class SingleMessageNotificationCreator(
.setLockScreenNotification(baseNotificationData, singleNotificationData.addLockScreenNotification) .setLockScreenNotification(baseNotificationData, singleNotificationData.addLockScreenNotification)
.build() .build()
if (isGroupSummary) {
Timber.v(
"Creating single summary notification (silent=%b): %s",
singleNotificationData.isSilent,
notification
)
}
notificationManager.notify(notificationId, notification) notificationManager.notify(notificationId, notification)
} }

View file

@ -7,6 +7,7 @@ import androidx.core.app.NotificationManagerCompat
import com.fsck.k9.Account import com.fsck.k9.Account
import com.fsck.k9.notification.NotificationChannelManager.ChannelType import com.fsck.k9.notification.NotificationChannelManager.ChannelType
import com.fsck.k9.notification.NotificationIds.getNewMailSummaryNotificationId import com.fsck.k9.notification.NotificationIds.getNewMailSummaryNotificationId
import timber.log.Timber
import androidx.core.app.NotificationCompat.Builder as NotificationBuilder import androidx.core.app.NotificationCompat.Builder as NotificationBuilder
internal class SummaryNotificationCreator( internal class SummaryNotificationCreator(
@ -73,6 +74,7 @@ internal class SummaryNotificationCreator(
.setLockScreenNotification(baseNotificationData) .setLockScreenNotification(baseNotificationData)
.build() .build()
Timber.v("Creating inbox-style summary notification (silent=%b): %s", notificationData.isSilent, notification)
notificationManager.notify(notificationData.notificationId, notification) notificationManager.notify(notificationData.notificationId, notification)
} }