mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-04-22 01:40:07 +01:00
Fix various compiler warnings.
This commit is contained in:
@@ -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 {
|
||||
|
||||
@@ -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")
|
||||
|
||||
Reference in New Issue
Block a user