fix #202: fallback to default ringtone when alarm audio is missing#420
fix #202: fallback to default ringtone when alarm audio is missing#420wellorbetter wants to merge 2 commits intoFossifyOrg:mainfrom
Conversation
wellorbetter
left a comment
There was a problem hiding this comment.
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.
Fallback to default ringtone when alarm audio file is missing
Type of change(s)
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
Closes the following issue(s)
Checklist
CHANGELOG.md(if applicable).