On my Samsung Galaxy S7, whenever the device goes to sleep, the Wifi goes to sleep as well.
* If I'm connected to a WiFi network and the device is idle for about 10 minutes (tested it), the device won't be connected to the WiFi network anymore (ping is unreachable)
* If entering a WiFi network area and device is idle, it won't connect to the network until I turn on the device manually.
There are exceptions:
* While charging
* When disabling
deviceidle option via adb (
adb shell dumpsys deviceidle disable), the problem is the option is reset after reboot
What I've checked so far ?
* Different Wifi networks
* All 'Keep WiFi on during sleep' options
* All 'Smart network switch' options
* Setting my router to specific channel and not auto
* Manually disabling almost all possible apps under 'doze' option
* An app to 'keep the device alive'
IMHO, as disabling 'deviceidle' actually fixes the issue (until next reboot), it's some kind of a bug in Android which tries to optimize the WiFi process, but, I hope someone proves me wrong.