mirror of
https://github.com/permissionlesstech/bitchat-android.git
synced 2026-08-15 06:56:30 +00:00
Long transfers — especially over Tor — can exceed WorkManager's ~10-minute background execution window, getting the worker stopped and rescheduled repeatedly. Promote the download to foreground work with a progress notification (cancel action included) so it can run to completion. - setForeground() with FOREGROUND_SERVICE_TYPE_DATA_SYNC; the manifest already holds the FOREGROUND_SERVICE_DATA_SYNC permission, and the WorkManager SystemForegroundService is merged with type dataSync. - If Android 12+ rejects the promotion (app backgrounded), the worker logs and continues as regular background work, relying on Range-resume. - Notification updates are throttled to 5% steps and degrade gracefully without POST_NOTIFICATIONS. Addresses the Codex review finding on ApkDownloadWorker. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>