问题
I am developing app to check WiFi status ,If no WiFi connectivity app has to show disconnect symbol.From Marshmallow on wards,If device enters in to "Doze mode",My device network enters in to suspended mode.If I wake my device up by pressing power button,Will WiFi automatically become Active state?
回答1:
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.
来源:https://stackoverflow.com/questions/50126567/doze-mode-vs-network-status