Skip to content

Feature request: skip an alarm on days with a calendar event containing a tag (e.g. #holiday) #60

Closed

Description

@zero0n3

Summary

Let each alarm be linked to a tag (e.g. #holiday). If a calendar event on that day has the tag in its title, that alarm is skipped for that day only and resumes the next day.

Motivation

The current "skip on holidays" option relies on public-holiday data, and vacation mode is a global window for recurring alarms. Neither covers what happens in practice: personal leave, a single day off, a trip, a strike day. Sleep as Android handled this with a calendar tag: I add an event titled #holiday and the matching alarm is skipped that day, with no changes to the alarm itself. The calendar is already where I record these days.

Proposed behavior

  1. In the alarm editor, next to "Skip on holidays", add "Skip when a calendar event contains…" with a text field (e.g. #holiday). Empty means disabled, so existing alarms behave as today.
  2. When computing the next occurrence, check the calendar for events on that day. All-day and multi-day events count.
  3. If an event title contains the tag (case-insensitive), skip that occurrence and move to the next valid one.
  4. Different alarms can use different tags (#holiday, #workoff, #travel).
  5. Show the reason in the alarm list, e.g. "Skipped: #holiday".

Proposed implementation

I read through the code, and most of the pieces already exist:

  • AlarmScheduler.schedule() already has the holiday-skip flow: advanceTriggerPastHolidays() for recurring alarms, and suspension for one-shot alarms. The calendar check can sit right next to it, with the same structure.
  • CalendarRepository already queries CalendarContract.Instances (so recurring events are expanded) and getEvents(start, end) already returns title and all-day flag.
  • VacationAlarmPolicy is a good model for a pure, testable policy object. I'd add a CalendarSkipPolicy in domain/.

Changes:

  1. New field on Alarm (e.g. skipCalendarTag: String = ""), with a Room migration, backup mapping (AlarmBackupMappers) and editor UI.
  2. New CalendarSkipPolicy in domain/. Given a date, a tag and a list of events, it returns whether to skip.
  3. In schedule(), a skip step like the holiday one, including re-applying vacation and holiday checks if the date moves.
  4. Re-evaluate when the calendar changes, so events added after the alarm was set still work. The existing 15-minute periodic worker could cover a first version. A ContentObserver on the calendar would be better.

Edge cases

  • All-day events are stored in UTC. The date comparison has to account for this, or the skip can shift by a day depending on timezone.
  • The existing query filters on BEGIN only. Multi-day events (e.g. a week of leave) must match every day they cover.
  • Unlike CalendarAutoAlarmWorker, which ignores all-day events on purpose, this feature must include them.
  • If calendar permission is missing, the alarm should behave as if no tag were set.

Acceptance criteria

  • An event #holiday on Tuesday skips only Tuesday's alarm that uses this tag; other alarms are unaffected.
  • A multi-day #holiday event skips every day it covers.
  • Deleting or editing the event before the alarm time restores the alarm.
  • Works after a reboot.
  • Alarms without a tag behave exactly as today.
  • Unit tests for the policy, covering all-day events across timezones.

Alternatives considered

  • Global vacation mode: not flexible enough for single days or per-alarm choices.
  • Per-alarm pause (already in the roadmap as P3): needs manual setup for each day, while the calendar is where these dates are already recorded.

Activity

  1. SysAdminDoc commented on Nov 12, 2026

    @SysAdminDoc
    Owner

    Added for the next release. Put #holiday in the alarm's new Skip when a calendar event contains field and any day with an event titled that way gets skipped. Delete the event and it'll ring again.

  2. SysAdminDoc commented on Nov 15, 2026

    @SysAdminDoc
    Owner

    Calendar skipping is in v1.16.0 now, closing this one 🙂 If it misses a day it should have skipped, let me know here and I'll reopen it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions