Skip to content

feat: auto-dismiss notifications per app after a set time - #1506

Open
jawzf wants to merge 1 commit into
sameerasw:developfrom
jawzf:feat/025-notification-auto-dismiss
Open

jawzf wants to merge 1 commit into
sameerasw:developfrom
jawzf:feat/025-notification-auto-dismiss

Conversation

@jawzf

@jawzf jawzf commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

Description

Adds Auto-dismiss notifications under Notifications and Alerts: choose apps, give each its own time (1 min to 24 h), and their notifications are cleared once they've been showing that long.

  • Per-app time: tap an app to set it with a slider (1, 5, 10, 15, 30 min, 1, 2, 3, 6, 12, 24 h). A newly added app gets the last time used, 15 min the first time.
  • Categories: each app's sheet lists the notification categories (channels) it has sent, all on by default. Switch one off to keep that kind of notification. Android doesn't let a listener list another app's channels up front, so they're learned as notifications arrive, with names from the listener's Ranking. Only apps on the list are recorded.
  • Updates restart the timer: a notification updated with new content stays for the full time after its latest change. Unchanged reposts (NotificationRepostFilter) keep the existing timer.
  • Never touched: notifications that can't be swiped away (music, downloads, calls, navigation), Essentials' own, and ones LiveUpdateSnoozer is holding. A group summary is cleared with its last child, never on its own timer.
  • Cleared count: each app shows how many of its notifications were cleared since it was added ("1 min · 3 cleared", and "3 notifications cleared since …" in its sheet). Only the number is stored, never notification content; Android's notification history already has the notifications. Removing an app resets it.
  • Removing an app: each row has a visible remove button; the long-press menu still works too.
  • Help: the feature's about text explains the steps, including categories and the count.

How: NotificationAutoDismisser (next to LiveUpdateSnoozer) keeps one main-thread Handler callback per notification key. On listener connect and on every settings change it resyncs from the active notifications: overdue ones are dismissed straight away, the rest are scheduled. No polling, alarms or wakelocks; in deep Doze a dismissal can run a little late. The deadline rule is a pure function (AutoDismissMath.kt) with unit tests. Settings use SettingsRepository; the page reuses AppSelectionSheet, FeatureCard, ConfigSliderItem and IconToggleItem.

Type of change

  • Bug fix
  • New feature
  • UI / visual update
  • Performance improvement
  • Refactoring / cleanup
  • Translations
  • Build / CI tooling

UI changes

1_list.png

The new entry under Notifications and Alerts.

2_page.png

The page: a chosen app with its time and cleared count, and the remove button.

3_time.png

An app's sheet: time, cleared count and categories.

4_categories.png

An app's categories, learned from its notifications.

5_help.png

The help text.

Checklist

  • The base branch is set to develop (not main).
  • The app builds cleanly locally with ./gradlew assembleDebug.
  • Unit tests pass with ./gradlew testDebugUnitTest.
  • You tested the changes on a device or emulator (including Shizuku or Root if applicable).
  • New preferences use SettingsRepository for keys and getter/setter methods.
  • New user-facing settings are registered in FeatureRegistry.kt for search indexing.
  • New UI follows the design system in ui/core/ (RoundedCardContainer, IconToggleItem, etc.).
  • Strings are added to res/values/strings.xml and drawables use rounded variants (R.drawable.rounded_*).

🤖 Generated with Claude Code

Adds an Auto-dismiss notifications page under Notifications. Pick apps
and a time for each (1 min to 24 h); their clearable notifications are
dismissed once that time has passed since the latest change. Each app's
notification categories are learned as they arrive and can be switched
off to keep them. Rows have a remove button and show how many
notifications were cleared since the app was added (count only).
Ongoing notifications are never touched, and a group summary is cleared
with its last child. Pending dismissals are resynced when the listener
connects and whenever the settings change.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@jawzf
jawzf force-pushed the feat/025-notification-auto-dismiss branch from cd730b7 to 39c8058 Compare October 25, 2026 09:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Backlog

Development

Successfully merging this pull request may close these issues.

1 participant