Is there any documentation on how frequent are doze mode maintenance windows in Android? I have read different things but nothing official. Someone said its 1, 2, 4, 6 hrs and then maintenance window re-occurs every 6 hours but could not find it anywhere in android documentation.
Testing your app with Doze You can test Doze mode by following these steps: Configure a hardware device or virtual device with an Android 6.0 (API level 23) or higher system image. Connect the device to your development machine and install your app. Run your app and leave it active.
Network access is disabled in doze mode, regardless if your application is ignoring battery optimizations. The only way to wake-up your device from doze mode and to get network access is by sending a high priority Google Cloud Message to your application.
Doze. Doze extends battery life by deferring app background CPU and network activity when a device is unused for long periods. Idle devices in Doze periodically enter a maintenance window, during which apps can complete pending work (syncs, jobs, etc.).
In order to make the battery life of your phone more efficient and increase the screen on time duration, Doze mode tunes down the background processing ability of your Android device by automatically recognizing that the phone isn't being used for a long duration.
It seems that we can do assumption only about duration of maintenance windows, rather than about frequency. As docs say, it's unstable value:
Over time, the system schedules maintenance windows less and less frequently, helping to reduce battery consumption in cases of longer-term inactivity when the device is not connected to a charger.
And what about duration of maintenance windows, it seems that they should be equal 10 minutes for jobs and network connectivity, and 10 seconds for alarms. From docs:
** If jobs restrictions are in force, the app is granted a window of ten minutes at the specified interval. At the end of the ten minutes, all jobs are postponed until the next window.
† If alarm restrictions are in force, all alarms will fire at the scheduled window, and run for a maximum of 10 seconds.
‡ If network access is restricted, the app is granted a window of 10 minutes to use the network at the specified interval.
P.S. There are also Doze-on-the-go, or Light Doze, since Android Nougat, and in that new mode the maintenance windows are more frequent than what we saw with Deep Doze (on plain Doze mode). P.P.S. It's possible also that OEMs are free to tweak the different timeout values.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With