-
-
Notifications
You must be signed in to change notification settings - Fork 36
Use foreground service for sounding alarms #133
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Conversation
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
Alarm/timer notifications shouldn't be dismissed automatically.
- Simplified the overengineered on/off screen notification logic. Alarms now use a notification with a full screen intent for reminder activity regardless of the device state. - Added a foreground service, the app will no longer rely on repeating notification sounds or the reminder activity for sounding alarms. - Simplified the reminder activity by delegating some responsibilities to the foreground service
It's not actually used, see #40
It's not needed anymore since we no longer rely on notifications for sounding alarms
- Replaced repeated code with `notificationManager` extension - Formatted code
Alarm was being dismissed automatically when notification was tapped twice.
- Renamed `EarlyAlarmDismissalReceiver` to `UpcomingAlarmReceiver` - Renamed `triggerEarlyDismissalNotification` to `showUpcomingAlarmNotification`
7 tasks
Previously the logic was all over the place. This commit combines alarm scheduling and dismissal logic into a central AlarmController class to improve code organization and maintainability. Changes: - Created AlarmController singleton to centralize alarm operations - Renamed receivers to match their actual functions - Update services and activities to utilize the new controller class - Clean up redundant code and improve naming conventions
One-time alarms were being scheduled and triggered multiple times due to this.
Activity was never finished when alarm was stopped using notification actions.
Replaced `stopSelf()` call with `alarmController.stopAlarm(alarmId)`. This ensures that: - Onetime alarms are disabled properly - Alarm activity is finished when alarm is stopped - Widgets and other views are updated properly.
6 tasks
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
Some more details in the commit messages.
Fixes the following issue(s)
Acknowledgement