Repository: thunderbird/thunderbird-android
File: legacy/core/src/main/java/com/fsck/k9/notification/LockScreenNotificationCreator.kt (Kotlin)

Code before:
                builder.setPublicVersion(publicNotification)
            }
        }
    }

    private fun createPublicNotificationWithSenderList(baseNotificationData: BaseNotificationData): Notification {
        val notificationData = baseNotificationData.lockScreenNotificationData as LockScreenNotificationData.SenderNames
        return createPublicNotification(baseNotificationData)
            .setContentText(notificationData.senderNames)
            .build()
    }

    private fun createPublicNotificationWithNewMessagesCount(baseNotificationData: BaseNotificationData): Notification {
        return createPublicNotification(baseNotificationData)
            .setContentText(baseNotificationData.accountName)
            .build()
    }

    private fun createPublicNotification(baseNotificationData: BaseNotificationData): NotificationCompat.Builder {
        val account = baseNotificationData.account
        val newMessagesCount = baseNotificationData.newMessagesCount
        val title = resourceProvider.newMessagesTitle(newMessagesCount)

        Timber.tag("NotificationDebug").d("Creating public notification in Thunderbird")
        Timber.tag("NotificationDebug").d("Using icon resource ID: ${resourceProvider.iconNewMail}")

        return notificationHelper.createNotificationBuilder(account, NotificationChannelManager.ChannelType.MESSAGES)
            .setSmallIcon(resourceProvider.iconNewMail)
            .setColor(baseNotificationData.color)
            .setNumber(newMessagesCount)
            .setContentTitle(title)
            .setCategory(NotificationCompat.CATEGORY_EMAIL)
    }
}


Review comment (refactor):
Please, do not use `Timber` directly. You should inject the `Logger` interface in this class constructor if you want to log here. 

```kotlin
internal class LockScreenNotificationCreator(
    private val notificationHelper: NotificationHelper,
    private val resourceProvider: NotificationResourceProvider,
    private val logger: Logger,
) {
    // .. other stuff

    private fun createPublicNotification(baseNotificationData: BaseNotificationData): NotificationCompat.Builder {
        // .. other stuff
        logger.d { "Creating public notification in Thunderbird" }
        logger.d { "Using icon resource ID: ${resourceProvider.iconNewMail}" }
        // .. other stuff
    }
}
```

Code after:
            }
        }
    }

    private fun createPublicNotificationWithSenderList(baseNotificationData: BaseNotificationData): Notification {
        val notificationData = baseNotificationData.lockScreenNotificationData as LockScreenNotificationData.SenderNames
        return createPublicNotification(baseNotificationData)
            .setContentText(notificationData.senderNames)
            .build()
    }

    private fun createPublicNotificationWithNewMessagesCount(baseNotificationData: BaseNotificationData): Notification {
        return createPublicNotification(baseNotificationData)
            .setContentText(baseNotificationData.accountName)
            .build()
    }

    private fun createPublicNotification(baseNotificationData: BaseNotificationData): NotificationCompat.Builder {
        val account = baseNotificationData.account
        val newMessagesCount = baseNotificationData.newMessagesCount
        val title = resourceProvider.newMessagesTitle(newMessagesCount)

        return notificationHelper.createNotificationBuilder(account, NotificationChannelManager.ChannelType.MESSAGES)
            .setSmallIcon(resourceProvider.iconNewMail)
            .setColor(baseNotificationData.color)
            .setNumber(newMessagesCount)
            .setContentTitle(title)
            .setCategory(NotificationCompat.CATEGORY_EMAIL)
    }
}