From 947347b3f178d949d9f1c264a1cdca3a7adffb76 Mon Sep 17 00:00:00 2001 From: Benoit Marty Date: Mon, 27 Oct 2025 12:32:36 +0100 Subject: [PATCH] Move call to `setGroup` to `configureWith` --- .../impl/notifications/factories/NotificationCreator.kt | 8 +------- 1 file changed, 1 insertion(+), 7 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 411cb25db1..79b4bb7db0 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 @@ -155,9 +155,6 @@ class DefaultNotificationCreator( setShortcutId(createShortcutId(roomInfo.sessionId, roomInfo.roomId)) } } - // Auto-bundling is enabled for 4 or more notifications on API 24+ (N+) - // devices and all Wear devices. But we want a custom grouping, so we specify the groupID - .setGroup(roomInfo.sessionId.value) .setGroupSummary(false) // In order to avoid notification making sound twice (due to the summary notification) .setGroupAlertBehavior(NotificationCompat.GROUP_ALERT_CHILDREN) @@ -236,7 +233,6 @@ class DefaultNotificationCreator( .setOnlyAlertOnce(true) .setContentTitle((inviteNotifiableEvent.roomName ?: buildMeta.applicationName).annotateForDebug(5)) .setContentText(inviteNotifiableEvent.description.annotateForDebug(6)) - .setGroup(inviteNotifiableEvent.sessionId.value) .setGroupAlertBehavior(NotificationCompat.GROUP_ALERT_ALL) .configureWith(notificationAccountParams) .apply { @@ -277,7 +273,6 @@ class DefaultNotificationCreator( .setOnlyAlertOnce(true) .setContentTitle(buildMeta.applicationName.annotateForDebug(7)) .setContentText(simpleNotifiableEvent.description.annotateForDebug(8)) - .setGroup(simpleNotifiableEvent.sessionId.value) .setGroupAlertBehavior(NotificationCompat.GROUP_ALERT_ALL) .configureWith(notificationAccountParams) .setAutoCancel(true) @@ -308,7 +303,6 @@ class DefaultNotificationCreator( .setOnlyAlertOnce(true) .setContentTitle(buildMeta.applicationName.annotateForDebug(7)) .setContentText(fallbackNotifiableEvent.description.orEmpty().annotateForDebug(8)) - .setGroup(fallbackNotifiableEvent.sessionId.value) .setGroupAlertBehavior(NotificationCompat.GROUP_ALERT_ALL) .configureWith(notificationAccountParams) .setAutoCancel(true) @@ -343,7 +337,6 @@ class DefaultNotificationCreator( // used in compat < N, after summary is built based on child notifications .setWhen(lastMessageTimestamp) .setCategory(NotificationCompat.CATEGORY_MESSAGE) - .setGroup(userId.value) // set this notification as the summary for the group .setGroupSummary(true) .configureWith(notificationAccountParams) @@ -476,6 +469,7 @@ class DefaultNotificationCreator( private fun NotificationCompat.Builder.configureWith(notificationAccountParams: NotificationAccountParams) = apply { setSmallIcon(CommonDrawables.ic_notification) setColor(notificationAccountParams.color) + setGroup(notificationAccountParams.user.userId.value) if (notificationAccountParams.showSessionId) { setSubText(notificationAccountParams.user.userId.value) }