Skip to content

Conversation

@williscool
Copy link
Owner

@williscool williscool commented Jan 6, 2026

Summary

Added setGroupAlertBehavior(NotificationCompat.GROUP_ALERT_CHILDREN) to three places in EventNotificationManager.kt:

1. Group Summary Notification (postGroupNotification) - line ~1014

val groupBuilder = NotificationCompat.Builder(ctx, NotificationChannels.CHANNEL_ID_DEFAULT)
        .setGroupSummary(true)
        .setGroup(NOTIFICATION_GROUP)
        .setGroupAlertBehavior(NotificationCompat.GROUP_ALERT_CHILDREN)  // <-- Added
        // ...

2. Individual Event Notifications (postNotification) - line ~1178

if (notificationSettings.useBundledNotifications) {
    builder.setGroup(NOTIFICATION_GROUP)
    builder.setGroupAlertBehavior(NotificationCompat.GROUP_ALERT_CHILDREN)  // <-- Added
}

3. Partial Collapse Notifications (postNumNotificationsCollapsed) - line ~1541

if (notificationSettings.useBundledNotifications) {
    builder.setGroup(NOTIFICATION_GROUP)
    builder.setGroupAlertBehavior(NotificationCompat.GROUP_ALERT_CHILDREN)  // <-- Added
}

What This Does

GROUP_ALERT_CHILDREN tells Android:

  • Children notifications (individual events) should be the ones to make sound/vibrate
  • Group summary should NOT make sound when it appears or updates

This should fix the double notification sound issue on Samsung S22 (Android 16) where:

  1. First sound plays when individual event notifications are posted ✓
  2. Second sound was playing when Android collapsed them into a group ✗ → Now fixed

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

fixes #155


Note

Ensures grouped notifications only alert on child items, preventing duplicate sounds (e.g., on Samsung devices) when using bundled notifications.

  • Add setGroupAlertBehavior(NotificationCompat.GROUP_ALERT_CHILDREN) to group summary in postGroupNotification
  • Apply the same behavior to individual notifications when useBundledNotifications in postNotification
  • Apply to partial-collapse summary in postNumNotificationsCollapsed

Written by Cursor Bugbot for commit 38d1fd7. This will update automatically on new commits. Configure here.

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
@github-actions
Copy link

github-actions bot commented Jan 6, 2026

Build artifacts for PR #156 (commit 24f79a5) are available:

You can download these artifacts from the "Artifacts" section of the workflow run.

@github-actions
Copy link

github-actions bot commented Jan 6, 2026

Code Coverage Report

Overall Project 32.6% -0.01% 🍏
Files changed 0%

Module Coverage
app 43.93% -0.01%
x8664Debug 21.51% -0.01%
Files
Module File Coverage
app EventNotificationManager.kt 43.12% -0.28%
x8664Debug EventNotificationManager.kt 5.71% -0.28%

@github-actions
Copy link

github-actions bot commented Jan 6, 2026

📊 Code Coverage Summary

Coverage Type Coverage
Overall 32.6
Changed Files 24.42

View detailed coverage report

@williscool williscool changed the title fix: Maybe double notification sounds on Samsung devices (issue #155) fix: double notification sounds on Samsung devices (issue #155) Jan 6, 2026
@williscool williscool merged commit 853a746 into master Jan 6, 2026
17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug: Double notification sounds on Samsung S22

2 participants