Commit Graph

2 Commits

Author SHA1 Message Date
Matthew Raymer
87f12a0029 refactor(android): P2.1 Batch A - delegate 7 plugin methods to services
P2.1 Batch A: Pure delegation refactoring (low-risk, read-only operations)

Completed Refactorings:
- checkStatus() → NotificationStatusChecker.getComprehensiveStatus()
- getNotificationStatus() → NotificationStatusChecker + NotificationStatusHelper
- checkPermissionStatus() → PermissionManager.checkPermissionStatus()
- isChannelEnabled() → ChannelManager methods
- isAlarmScheduled() → DailyNotificationScheduler.isScheduled()
- getNextAlarmTime() → DailyNotificationScheduler.getNextAlarmTime()
- getContentCache() → ContentCacheHelper.getLatest()

Service Enhancements:
- Added NotificationStatusChecker.getNotificationStatus() (delegates to helper)
- Added DailyNotificationScheduler.isScheduled() (wraps NotifyReceiver)
- Added DailyNotificationScheduler.getNextAlarmTime() (wraps NotifyReceiver)

Helper Objects Created:
- NotificationStatusHelper: Kotlin object for notification status queries
- ContentCacheHelper: Kotlin object for content cache operations

Code Reduction:
- ~181 lines removed from DailyNotificationPlugin.kt
- Logic moved to service layer (better separation of concerns)
- Plugin class now acts as thin adapter layer

Deferred:
- getExactAlarmStatus() (requires complex service initialization)

All methods maintain same API behavior. Plugin class complexity reduced.
Services already existed - this is delegation, not extraction.

Refs: docs/progress/P2.1-BATCH-A-STATE.md
2025-12-23 11:35:00 +00:00
Matthew Raymer
442c48c233 refactor(android): P2.1 Batch A - delegate status/permission methods to services
- Refactor checkStatus() to delegate to NotificationStatusChecker
- Refactor getNotificationStatus() to delegate to NotificationStatusChecker
- Refactor checkPermissionStatus() to delegate to PermissionManager
- Add service instance variables and initialization in load()
- Defer getExactAlarmStatus() (requires complex service initialization)

Reduces plugin class complexity by ~130 lines.
Services already exist - this is delegation, not extraction.

Refs: docs/progress/P2.1-BATCH-1.md
2025-12-23 10:38:39 +00:00