Network access in Android DOZE Mode

366 views Asked by At

The Android App targeting Android 9 and above is not been able to access the network in Doze mode. Have implemented a background sync service that pulls data from the central server in regular intervals. It all works till the time it enters into Doze mode where the Android 10 device can't access the network. I can see the foreground service initiating the sync process in regular intervals but because of network inaccessibility can't proceed further. I can't use High priority Google Cloud Message as the sync needs to be initiated from the device.

There are few questions asked on the topic but they are all outdated.

As per Google documentation https://developer.android.com/training/monitoring-device-state/doze-standby have tried everything. The app is in the whitelist of Non optimized App list in the device manually so don't need to call request_ignore_battery_optimizations

  • Alarm Manager with setExactAndAllowWhileIdle() and with/without request_ignore_battery_optimizations: Device wakes up in Doze mode but because of no network can’t perform sync

  • Foreground service and with/without request_ignore_battery_optimizations: Device wakes up in Doze mode but because of no network can’t perform sync

  • Foreground service with Wake locks: Don't work in Android 9 onwards

  • Always Screen On: Not recommended as the battery will be drained because of overnight syncs

Any advice will be much appreciated.

0

There are 0 answers