From f0ec0164efc73f3c2c4704bdb35480aa7f3a7283 Mon Sep 17 00:00:00 2001 From: Benoit Marty Date: Thu, 13 Nov 2025 11:41:11 +0100 Subject: [PATCH] Use the method `setLargeIcon(Bitmap?)` instead of `setLargeIcon(Icon?)` because it may scale the Bitmap on versions before API 27. Starting in API 27, the framework does this automatically. --- .../push/impl/notifications/factories/NotificationCreator.kt | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/libraries/push/impl/src/main/kotlin/io/element/android/libraries/push/impl/notifications/factories/NotificationCreator.kt b/libraries/push/impl/src/main/kotlin/io/element/android/libraries/push/impl/notifications/factories/NotificationCreator.kt index a69ce5e673..8324bd8bba 100755 --- a/libraries/push/impl/src/main/kotlin/io/element/android/libraries/push/impl/notifications/factories/NotificationCreator.kt +++ b/libraries/push/impl/src/main/kotlin/io/element/android/libraries/push/impl/notifications/factories/NotificationCreator.kt @@ -11,7 +11,6 @@ package io.element.android.libraries.push.impl.notifications.factories import android.app.Notification import android.content.Context import android.graphics.Bitmap -import android.graphics.drawable.Icon import androidx.annotation.ColorInt import androidx.core.app.NotificationCompat import androidx.core.app.NotificationCompat.MessagingStyle @@ -215,9 +214,7 @@ class DefaultNotificationCreator( if (openIntent != null) { setContentIntent(openIntent) } - if (largeIcon != null) { - setLargeIcon(Icon.createWithBitmap(largeIcon)) - } + setLargeIcon(largeIcon) setDeleteIntent(pendingIntentFactory.createDismissRoomPendingIntent(roomInfo.sessionId, roomInfo.roomId)) // If any of the events are of rtc notification type it means a missed call, set the category to the right value