Skip to content

feat: add setting to ignore silent notifications - #29

Merged
EvanKoe merged 1 commit into
EvanKoe:devfrom
anuragdeshpande:feat/ignore-silent-notifications-toggle
Aug 25, 2026
Merged

feat: add setting to ignore silent notifications#29
EvanKoe merged 1 commit into
EvanKoe:devfrom
anuragdeshpande:feat/ignore-silent-notifications-toggle

Conversation

@anuragdeshpande

Copy link
Copy Markdown

Summary

Modern Android versions allow notifications and notification channels to be marked as Silent or Default (Alerting). Silent notifications appear in the "Silent" section of the notification shade without playing sound, vibrating, or showing heads-up banners.

Previously, Expressive Cutout surfaced cutout bubble animations for all clearable notifications regardless of whether they were marked as silent or alerting. This PR introduces an opt-in toggle under Settings > Behavior ("Ignore silent notifications") that respects this Android system configuration and suppresses cutout bubbles for silent notifications.


What was done & Why

  1. Notification Silence Detection (NotificationClassifier & CutoutNotificationListenerService)

    • Implemented NotificationClassifier.isSilent(...) to evaluate notification importance and ambient status (importance < IMPORTANCE_DEFAULT or isAmbient == true), with backward-compatible priority fallback.
    • Updated CutoutNotificationListenerService.onNotificationPosted to receive RankingMap from Android's NotificationListenerService and tag CutoutSignal.Notification with isSilent: Boolean.
  2. User Preference & DataStore (BehaviourSettings, BehaviourPreferences, AppViewModel)

    • Added ignoreSilentNotifications: Boolean = false to BehaviourSettings.
    • Added DataStore persistence, JSON serialization/deserialization for settings backup/restore, and ViewModel binding.
  3. Overlay Bubble Filtering (IslandOverlayController)

    • When ignoreSilentNotifications is enabled, IslandOverlayController skips displaying cutout bubble overlays for notifications where signal.isSilent == true.
  4. Settings UI (BehaviourScreen, strings.xml)

    • Added the "Ignore silent notifications" toggle card under Settings > Behavior.
  5. Testability & Unit Tests (SilentNotificationTest)

    • Introduced JUnit test support to the project (testImplementation(libs.junit) in build.gradle.kts and libs.versions.toml).
    • Added SilentNotificationTest covering importance classification, ambient status, fallback priorities, signal flags, and filtering logic to guarantee regression prevention.

How it helps the Application & System

  • User Experience: Users who intentionally silence low-priority notifications (e.g. background syncs, weather updates, ongoing status updates) won't have their screen interrupted by popping cutout bubbles.
  • System Resource Efficiency: By dropping silent notifications early when configured, the overlay avoids unnecessary compose layout passes and spatial spring animation overhead.
  • Improved Codebase Quality & Testability: Adds unit testing infrastructure and isolated unit tests to ensure future notification parsing and filtering remains reliable.

@EvanKoe
EvanKoe changed the base branch from main to dev August 24, 2026 08:30
@EvanKoe

EvanKoe commented Aug 24, 2026

Copy link
Copy Markdown
Owner

Same as #33 : I need you to rebase from dev, especially on the CutoutNotificationListener, who got a big refactor in #27

- Inspect notification importance and ambient status to classify silent notifications
- Add 'ignoreSilentNotifications' preference under Settings > Behavior
- Suppress cutout bubble notifications when silent notifications are ignored
- Introduce unit tests and JUnit dependency for notification classification and filtering
@anuragdeshpande
anuragdeshpande force-pushed the feat/ignore-silent-notifications-toggle branch from 26f7254 to 0995ba7 Compare August 24, 2026 14:31
@anuragdeshpande

Copy link
Copy Markdown
Author

Rebased onto dev and resolved conflicts with the recent listener refactor. Ready for review!

@EvanKoe

EvanKoe commented Aug 25, 2026

Copy link
Copy Markdown
Owner

Lgtm, tested on my end.

@EvanKoe
EvanKoe merged commit 26e9eb3 into EvanKoe:dev Aug 25, 2026
1 check 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.

2 participants