Fix kotlin compiler warnings.

This commit is contained in:
Cody Henthorne
2021-09-16 11:45:50 -04:00
committed by Alex Hart
parent 8984b763fb
commit 3761859681
44 changed files with 96 additions and 84 deletions

View File

@@ -263,7 +263,7 @@ sealed class NotificationBuilder(protected val context: Context) {
val personBuilder: PersonCompat.Builder = PersonCompat.Builder()
.setBot(false)
.setName(notificationItem.getPersonName(context))
.setUri(notificationItem.getPersonUri(context))
.setUri(notificationItem.getPersonUri())
.setIcon(notificationItem.getPersonIcon(context).toIconCompat())
if (includeShortcut) {
@@ -330,9 +330,7 @@ sealed class NotificationBuilder(protected val context: Context) {
0
)
val bubbleMetadata = NotificationCompat.BubbleMetadata.Builder()
.setIntent(intent)
.setIcon(AvatarUtil.getIconCompatForShortcut(context, conversation.recipient))
val bubbleMetadata = NotificationCompat.BubbleMetadata.Builder(intent, AvatarUtil.getIconCompatForShortcut(context, conversation.recipient))
.setAutoExpandBubble(bubbleState === BubbleUtil.BubbleState.SHOWN)
.setDesiredHeight(600)
.setSuppressNotification(bubbleState === BubbleUtil.BubbleState.SHOWN)

View File

@@ -56,14 +56,6 @@ data class NotificationConversation(
}
}
fun getContactUri(context: Context): String? {
return if (SignalStore.settings().messageNotificationsPrivacy.isDisplayContact) {
recipient.contactUri?.toString()
} else {
null
}
}
fun getSlideBigPictureUri(context: Context): Uri? {
return if (notificationItems.size == 1 && SignalStore.settings().messageNotificationsPrivacy.isDisplayMessage && !KeyCachingService.isLocked(context)) {
mostRecentNotification.getBigPictureUri()

View File

@@ -100,7 +100,7 @@ sealed class NotificationItemV2(val threadRecipient: Recipient, protected val re
return timestamp.compareTo(other.timestamp)
}
fun getPersonUri(context: Context): String? {
fun getPersonUri(): String? {
return if (SignalStore.settings().messageNotificationsPrivacy.isDisplayContact && individualRecipient.isSystemContact) {
individualRecipient.contactUri.toString()
} else {