Search code examples
androiddoze

Doze mode vs Network Status


I am developing an app to check Wi-Fi status. If there aren't Wi-Fi connection, the app has to show the disconnect symbol. From Marshmallow onwards, if the device enters in "Doze mode", my device network enters into suspended mode.

If I wake my device up by pressing the power button, will Wi-Fi automatically become Active state?


Solution

  • Network will be always active, its just the access to it by apps gets suspended. System decides when to allow it.

    Based on the documentation:

    As soon as the user wakes the device by moving it, turning on the screen, or connecting a charger, the system exits Doze and all apps return to normal activity

    So if you turn on the screen, then the access to network will be granted, provided you app is not in standby mode.