From 38d1fd7e22faa2442cc335b20b5ad3eac813237e Mon Sep 17 00:00:00 2001 From: William Harris Date: Tue, 6 Jan 2026 02:07:26 +0000 Subject: [PATCH] fix: Maybe double notification sounds on Samsung devices (issue #155) Add setGroupAlertBehavior(GROUP_ALERT_CHILDREN) to bundled notifications to prevent group summaries from triggering additional alert sounds. On Samsung S22 with Android 16, when multiple event notifications were collapsed into a group, the group summary would trigger a second notification sound. This fix explicitly tells Android that only child notifications should alert, not the group summary. Changes: - postGroupNotification: Added GROUP_ALERT_CHILDREN to group summary - postNotification: Added GROUP_ALERT_CHILDREN to individual notifications - postNumNotificationsCollapsed: Added GROUP_ALERT_CHILDREN to partial collapse --- .../quarck/calnotify/notification/EventNotificationManager.kt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/android/app/src/main/java/com/github/quarck/calnotify/notification/EventNotificationManager.kt b/android/app/src/main/java/com/github/quarck/calnotify/notification/EventNotificationManager.kt index da98b019..f8334b34 100644 --- a/android/app/src/main/java/com/github/quarck/calnotify/notification/EventNotificationManager.kt +++ b/android/app/src/main/java/com/github/quarck/calnotify/notification/EventNotificationManager.kt @@ -1011,6 +1011,7 @@ open class EventNotificationManager : EventNotificationManagerInterface { .setSubText(text) .setGroupSummary(true) .setGroup(NOTIFICATION_GROUP) + .setGroupAlertBehavior(NotificationCompat.GROUP_ALERT_CHILDREN) .setContentIntent(pendingIntent) .setCategory( NotificationCompat.CATEGORY_EVENT @@ -1173,6 +1174,7 @@ open class EventNotificationManager : EventNotificationManagerInterface { if (notificationSettings.useBundledNotifications) { builder.setGroup(NOTIFICATION_GROUP) + builder.setGroupAlertBehavior(NotificationCompat.GROUP_ALERT_CHILDREN) } var snoozePresets = @@ -1536,6 +1538,7 @@ open class EventNotificationManager : EventNotificationManagerInterface { if (notificationSettings.useBundledNotifications) { builder.setGroup(NOTIFICATION_GROUP) + builder.setGroupAlertBehavior(NotificationCompat.GROUP_ALERT_CHILDREN) } if (notificationSettings.led.on && (!isQuietPeriodActive || !settings.quietHoursMuteLED)) {