Fix various compiler warnings.

This commit is contained in:
Cody Henthorne
2022-12-12 15:21:09 -05:00
parent 819c9f61dc
commit c5b4f44ab8
26 changed files with 48 additions and 54 deletions

View File

@@ -99,7 +99,7 @@ data class NotificationConversation(
return notificationItems.any { it.isNewNotification }
}
fun getChannelId(context: Context): String {
fun getChannelId(): String {
return if (isOnlyContactJoinedEvent) {
NotificationChannels.getInstance().JOIN_EVENTS
} else {

View File

@@ -188,7 +188,7 @@ object NotificationFactory {
setCategory(NotificationCompat.CATEGORY_MESSAGE)
setGroup(DefaultMessageNotifier.NOTIFICATION_GROUP)
setGroupAlertBehavior(NotificationCompat.GROUP_ALERT_CHILDREN)
setChannelId(conversation.getChannelId(context))
setChannelId(conversation.getChannelId())
setContentTitle(conversation.getContentTitle(context))
setLargeIcon(conversation.getContactLargeIcon(context).toLargeBitmap(context))
addPerson(conversation.recipient)
@@ -221,7 +221,7 @@ object NotificationFactory {
val notificationId: Int = if (Build.VERSION.SDK_INT < 24) NotificationIds.MESSAGE_SUMMARY else conversation.notificationId
NotificationManagerCompat.from(context).safelyNotify(context, conversation.recipient, notificationId, builder.build())
NotificationManagerCompat.from(context).safelyNotify(conversation.recipient, notificationId, builder.build())
}
private fun notifySummary(context: Context, state: NotificationState) {
@@ -257,7 +257,7 @@ object NotificationFactory {
}
Log.d(TAG, "showing summary notification")
NotificationManagerCompat.from(context).safelyNotify(context, null, NotificationIds.MESSAGE_SUMMARY, builder.build())
NotificationManagerCompat.from(context).safelyNotify(null, NotificationIds.MESSAGE_SUMMARY, builder.build())
}
private fun notifyInThread(context: Context, recipient: Recipient, lastAudibleNotification: Long) {
@@ -326,7 +326,7 @@ object NotificationFactory {
setChannelId(NotificationChannels.getInstance().FAILURES)
}
NotificationManagerCompat.from(context).safelyNotify(context, recipient, NotificationIds.getNotificationIdForMessageDeliveryFailed(thread), builder.build())
NotificationManagerCompat.from(context).safelyNotify(recipient, NotificationIds.getNotificationIdForMessageDeliveryFailed(thread), builder.build())
}
fun notifyProofRequired(context: Context, recipient: Recipient, thread: ConversationId, visibleThread: ConversationId?) {
@@ -356,7 +356,7 @@ object NotificationFactory {
setChannelId(NotificationChannels.getInstance().FAILURES)
}
NotificationManagerCompat.from(context).safelyNotify(context, recipient, NotificationIds.getNotificationIdForMessageDeliveryFailed(thread), builder.build())
NotificationManagerCompat.from(context).safelyNotify(recipient, NotificationIds.getNotificationIdForMessageDeliveryFailed(thread), builder.build())
}
@JvmStatic
@@ -379,7 +379,7 @@ object NotificationFactory {
setColor(ContextCompat.getColor(context, R.color.core_ultramarine))
setCategory(NotificationCompat.CATEGORY_MESSAGE)
setGroup(DefaultMessageNotifier.NOTIFICATION_GROUP)
setChannelId(conversation.getChannelId(context))
setChannelId(conversation.getChannelId())
setContentTitle(conversation.getContentTitle(context))
setLargeIcon(conversation.getContactLargeIcon(context).toLargeBitmap(context))
addPerson(conversation.recipient)
@@ -390,10 +390,10 @@ object NotificationFactory {
}
Log.d(TAG, "Posting Notification for requested bubble")
NotificationManagerCompat.from(context).safelyNotify(context, recipient, conversation.notificationId, builder.build())
NotificationManagerCompat.from(context).safelyNotify(recipient, conversation.notificationId, builder.build())
}
private fun NotificationManagerCompat.safelyNotify(context: Context, threadRecipient: Recipient?, notificationId: Int, notification: Notification) {
private fun NotificationManagerCompat.safelyNotify(threadRecipient: Recipient?, notificationId: Int, notification: Notification) {
try {
notify(notificationId, notification)
Log.internal().i(TAG, "Posted notification: $notification")