Address some issues regarding missed alarms#132
Merged
naveensingh merged 7 commits intomasterfrom Mar 18, 2025
Merged
Conversation
Fixed crash `java.lang.IllegalStateException` in `updateAlarm()``
It seems faulty code was originally introduced in SimpleMobileTools/Simple-Clock#469 Before that PR, the code rescheduled enabled alarms when there were no scheduled alarms according to the system APIs. After that PR, the code rescheduled enabled alarms when there were NO enabled alarms enabled in the database i.e. a contradiction. See #89
Previously, the app didn't ask for notification permission unless the user tried to enable/disable an alarm. This is a problem in case the notifications were turned off (for whatever reason) after an alarm was configured. The user would think that everything is ok and miss their alarm. #89 (comment)
Same issue as 7d35b04. Original code relied on the scheduled alarms returned by the system as a filter but the updated code by SimpleMobileTools/Simple-Clock#469 clears/disables expired alarms when there are no enabled alarms which doesn't make much sense. One can not disable already disabled alarms
- Moved duplicated code to an extension - Removed alarm clearing logic from alarms fragment as it's not necessary there. Instead, the alarms fragment is refreshed by `disableExpiredAlarm()`. - Disabled expired alarms when alarms are auto dismissed as well.
Adapter was being passed the same list of alarms over and over
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What is it?
Description of the changes in your PR
IllegalStateExceptioninClockFragmentMainActivityso that alarms are properly rescheduled on startup. Before this change:Fixes the following issue(s)
Acknowledgement