Skip to content

Conversation

@naveensingh
Copy link
Member

@naveensingh naveensingh commented Mar 21, 2025

What is it?

  • Bugfix
  • Feature
  • Codebase improvement

Description of the changes in your PR

  • Added a foreground service for sounding alarms
  • Reworked alarm management
  • Simplified reminder activity
  • Removed unused code
  • Formatted code

Some more details in the commit messages.

Fixes the following issue(s)

Acknowledgement

naveensingh and others added 16 commits March 18, 2025 19:58
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 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`
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.
@naveensingh naveensingh marked this pull request as ready for review March 28, 2025 22:38
@naveensingh naveensingh added testers needed We need testers for this issue or pull request and removed testers needed We need testers for this issue or pull request labels Mar 28, 2025
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.
@naveensingh naveensingh merged commit a88bee8 into master Mar 29, 2025
3 of 5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants