Skip to content

fix #202: fallback to default ringtone when alarm audio is missing#420

Open
wellorbetter wants to merge 2 commits intoFossifyOrg:mainfrom
wellorbetter:audio
Open

fix #202: fallback to default ringtone when alarm audio is missing#420
wellorbetter wants to merge 2 commits intoFossifyOrg:mainfrom
wellorbetter:audio

Conversation

@wellorbetter
Copy link

@wellorbetter wellorbetter commented Mar 25, 2026

Fallback to default ringtone when alarm audio file is missing

Type of change(s)

  • Bug fix
  • Feature / enhancement
  • Infrastructure / tooling (CI, build, deps, tests)
  • Documentation

What changed and why

When an alarm rings, check if the custom audio file still exists. If it is missing (deleted, moved, or inaccessible), use the system default alarm ringtone to ensure the alarm always sounds instead of only vibrating.

Tests performed

  • Verified on device by setting an alarm with a custom ringtone, then deleting the file before alarm triggers – alarm still rings with default tone.

Closes the following issue(s)

Checklist

  • I read the contribution guidelines.
  • I manually tested my changes on device/emulator (if applicable).
  • I updated the "Unreleased" section in CHANGELOG.md (if applicable).
  • I have self-reviewed my pull request (no typos, formatting errors, etc.).
  • I understand every change in this pull request.

Copy link
Author

@wellorbetter wellorbetter left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Method: When the ringtone is about to ring, check if the corresponding file exists. If it doesn't exist, switch to the default ringtone.
Explain&Problem: I fixed this issue, but I found that there was a UI problem that I hadn't addressed. That is, after changing the default ringtone, the ringtone displayed for the alarm on this alarm page did not promptly change to the default ringtone. It's very strange. I used EventBus.getDefault().post(AlarmEvent.Refresh). Logically speaking, the AlarmFragment should receive it and call setupAlarms from context? .dbHelper? .getAlarms() retrieves the latest data, but in fact, the ringtone corresponding to the alarm on this page has not changed to the default one. It only takes effect when exiting and re-entering the page. I suspect there might be a timing issue.

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.

Show warning when alarm is set and the audio file doesn't exist anymore

1 participant