feat(reminders): snooze + dismiss notification actions
Add "Snooze" and "Dismiss" action buttons to reminder notifications. The app is otherwise pure provider-broadcast (the Etar model): the calendar provider fires EVENT_REMINDER and we post the notification, then mark the CalendarAlerts row fired. A snoozed reminder has no provider backing — its row is already fired — so snooze self-schedules an exact alarm to re-show the same notification, while primary delivery is left unchanged. - ReminderActionReceiver (not exported): SNOOZE cancels + schedules a re-show, DISMISS cancels, SHOW (the alarm) re-posts so it can be snoozed or dismissed again. - ReminderSnoozeScheduler: setExactAndAllowWhileIdle, with an inexact allow-while-idle fallback if exact alarms are revoked (API 31-32). - ReminderNotifier: two actions + cancel(). - snoozeMinutes pref (default 10) in Settings -> Notifications, OptionPicker presets 5/10/15/30/60. - Manifest: USE_EXACT_ALARM + SCHEDULE_EXACT_ALARM (maxSdk 32) + receiver. - New ic_notification_snooze/_dismiss drawables, duration plurals, en+de strings, snooze-pref tests. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -13,6 +13,17 @@
|
||||
-->
|
||||
<uses-permission android:name="android.permission.REQUEST_IGNORE_BATTERY_OPTIMIZATIONS" />
|
||||
|
||||
<!--
|
||||
Re-fire a snoozed reminder at an exact time (the calendar provider won't —
|
||||
its alert is already fired). USE_EXACT_ALARM is auto-granted to calendar
|
||||
apps on API 33+; SCHEDULE_EXACT_ALARM covers API 31–32 (user-revocable,
|
||||
with an inexact fallback if withheld). F-Droid-clean: no Play allowlisting.
|
||||
-->
|
||||
<uses-permission
|
||||
android:name="android.permission.SCHEDULE_EXACT_ALARM"
|
||||
android:maxSdkVersion="32" />
|
||||
<uses-permission android:name="android.permission.USE_EXACT_ALARM" />
|
||||
|
||||
<!-- Package visibility (Android 11+): without this, getLaunchIntentForPackage
|
||||
returns null and the calendar manager's per-account "manage" button can't
|
||||
open the source sync app (DAVx5, ICSx5, Google Calendar, …). The LAUNCHER
|
||||
@@ -91,6 +102,13 @@
|
||||
</intent-filter>
|
||||
</receiver>
|
||||
|
||||
<!-- Snooze / dismiss actions on a reminder notification, plus the snooze
|
||||
re-show alarm. Not exported: only our own notification buttons and
|
||||
AlarmManager PendingIntents target it. -->
|
||||
<receiver
|
||||
android:name=".data.reminders.ReminderActionReceiver"
|
||||
android:exported="false" />
|
||||
|
||||
<!-- Home-screen widgets (Glance). Exported: the launcher/host binds them. -->
|
||||
<receiver
|
||||
android:name=".widget.agenda.AgendaWidgetReceiver"
|
||||
|
||||
Reference in New Issue
Block a user