Fix widget auto-update and boot receiver reliability#296
Merged
Conversation
- Add QUICKBOOT_POWERON to manifest so widgets refresh on quick reboot - Update BootReceiver to trigger widget refresh and midnight scheduler on boot - Wrap MidnightWorker work in try/finally so midnight is always rescheduled even on failure - Remove HTC-specific boot broadcast action Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
EmmaTellblom
approved these changes
May 17, 2026
The default locale renamed these keys to add _with_bg/_no_bg suffixes, leaving the old keys as ExtraTranslation lint errors. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
EmmaTellblom
approved these changes
May 17, 2026
EmmaTellblom
approved these changes
May 17, 2026
EmmaTellblom
added a commit
that referenced
this pull request
Jun 14, 2026
* Initial plan * Implement widget auto-update functionality - Add onUpdate() override in all widget receivers to schedule MidnightWorker - Create BootReceiver to reschedule MidnightWorker after device reboot - Add RECEIVE_BOOT_COMPLETED permission to AndroidManifest - Add widget update trigger in MainActivity.onCreate() to refresh on app start - Emit to MidnightTrigger and call updateAll() on app start Co-authored-by: mrknutte26 <250676908+mrknutte26@users.noreply.github.com> * Address code review feedback - Use lifecycleScope instead of custom activityScope for better lifecycle management - Create BaseWidgetReceiver to eliminate code duplication across widget receivers - Set BootReceiver as exported=true to receive system broadcasts - Remove unnecessary onDestroy() override Co-authored-by: mrknutte26 <250676908+mrknutte26@users.noreply.github.com> * Add error handling and improve BroadcastReceiver reliability - Add try-catch block in updateWidgetsOnAppStart() to handle potential exceptions - Use goAsync() in BootReceiver to ensure work completes before receiver is killed - Add error logging for widget update failures Co-authored-by: mrknutte26 <250676908+mrknutte26@users.noreply.github.com> * Improve code organization and widget update performance - Organize imports in conventional order - Update widgets concurrently using async/await for better startup performance - Reduce widget update time on app start by parallelizing operations Co-authored-by: mrknutte26 <250676908+mrknutte26@users.noreply.github.com> * Optimize threading for widget updates and boot receiver - Use Dispatchers.IO in MainActivity for widget updates to avoid blocking UI thread - Use coroutine scope with Dispatchers.IO in BootReceiver to prevent ANR - Add comment explaining WorkManager's REPLACE policy prevents duplicate scheduling - Improve app startup performance by offloading widget updates to IO dispatcher Co-authored-by: mrknutte26 <250676908+mrknutte26@users.noreply.github.com> * Fix BootReceiver coroutine scope lifecycle - Use standalone coroutine scope for one-time operation instead of instance variable - Prevent resource leak by not storing coroutine scope in short-lived BroadcastReceiver - Ensure proper cleanup after boot completion handler finishes Co-authored-by: mrknutte26 <250676908+mrknutte26@users.noreply.github.com> * fixed widget update issue * added dbversion 11, missing... * Increased versionnumber and version name * Fixed version name, should still be 2.1 * Fixes for midnightworker * Fixed importExport dialog deprecated stuff * More changes for fixing widget * delay for 1 sec * Fix widget auto-update and boot receiver reliability (#296) * Fix widget boot reliability and midnight worker error handling - Add QUICKBOOT_POWERON to manifest so widgets refresh on quick reboot - Update BootReceiver to trigger widget refresh and midnight scheduler on boot - Wrap MidnightWorker work in try/finally so midnight is always rescheduled even on failure - Remove HTC-specific boot broadcast action Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * Remove orphaned widget string keys from ur and ml translations The default locale renamed these keys to add _with_bg/_no_bg suffixes, leaving the old keys as ExtraTranslation lint errors. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> --------- Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com> * fix for ml and ur * fix translations --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: mrknutte26 <250676908+mrknutte26@users.noreply.github.com> Co-authored-by: mrknutte26 <knut.tellblom@gmail.com> Co-authored-by: Magnus Tellblom <blytorsk@gmail.com> Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
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.
Summary
BootReceiverMidnightWorkerandPeriodCalculationWidgetUpdaterfor scheduled widget refreshBaseWidgetandWidgetInstancesExportImportDialogAndroidManifest.xmlTest plan
🤖 Generated with Claude Code