FULL AI ANALYSIS

Flutter background sync stops on certain Android 13 OEM ROMs when device Doze enters aggressive standby

Generated Oct 3, 2026, 12:35:03 AM

Analysis summary

OEM vendors often implement stricter battery optimizations than upstream Android, blocking alarms, jobs, and sometimes high-priority FCM. WorkManager is the recommended API and should survive Doze on Android stock devices, but vendor modifications can kill the host process or block scheduling. Foreground services or high-priority FCM messages are more reliable ways to wake code, but they carry UX and policy implications. The solution requires a combination of API best-practices, fallbacks, and user education for the smallest number of manual steps.

Possible causes

App not whitelisted for battery optimizations and therefore moved to deep idle by manufacturer heuristics.

100%

OEM-specific aggressive battery management kills background processes and blocks alarms/WorkManager execution.

95%

Use of plugins that rely on AlarmManager with non-RTC_WAKEUP flags that are deferred in Doze.

25%

WorkManager initialization not executed in Application.onCreate (embedding v2 mismatch) causing missed rescheduling after process restart (less likely given logs).

10%

Suggested fixes

1

Diagnostic step 1

Verify WorkManager initialization: ensure you initialize WorkManager in Application.onCreate using androidx.work.Configuration if required by plugin; test with a minimal native Android sample to rule out plugin bug.

2

Diagnostic step 2

Implement a documented fallback: use a short-lived foreground service for essential syncs (triggered by user action or when app is foreground) and avoid leaving it running permanently. This is reversible and visible to users via notification.

3

Diagnostic step 3

Use high-priority Firebase Cloud Messaging sparingly to wake the app for critical syncs; be mindful that OEMs may still throttle/ignore FCM. Do not abuse high-priority messages to avoid platform penalties.

4

Diagnostic step 4

Add runtime guidance and a one-time onboarding flow that detects aggressive OEM battery management (dumpsys heuristics) and prompts the user to whitelist the app with an ACTION_REQUEST_IGNORE_BATTERY_OPTIMIZATIONS intent and directs them to the OEM-specific settings page. Keep this as a last-resort and document why the user is asked to act.

5

Diagnostic step 5

Collect a bugreport (adb bugreport or manufacturer tool) from an affected device showing WorkManager schedules and dumpsys logs and submit to the flutter_workmanager plugin maintainers and OEM vendor if you believe the vendor is blocking standard APIs. Escalate to plugin maintainers only after confirming correct initialization; do not share user-identifying data in bugreports without consent.