Android WifiManager and Scanning Battery Performan

2019-06-17 05:00发布

问题:

To my understanding, one can request the WifiManager to start an AP scan, which is great and you get scan results back, but my question is regarding the continuous wifi scan that happens under the hood.

Aside from unregistering the wifi listener for scan callback, is disabling the wifi the only way to stop the hardware from scanning? So if my device is connected to some Wifi BSSID/SSID it's ALSO constantly scanning? (Yes http://www.androidauthority.com/community/threads/how-to-get-wifi-to-stop-scanning-after-connected.7760/) So if I request a scan while connected to some Wifi, it starts to constantly scan since there's no way to actually stop the scanning without turning off the hardware... at which point you lose connectivity with the Wifi Network, NOT acceptable.

Seems like an oversight from Google. Why didn't they just leave the hardware alone rather than make it constantly scan?! Unless provoked to start scanning, connect, disconnect, or stop scanning, DO NOT DO ANYTHING on your own... why didn't they implement it this way? My concern is battery drainage with continuous scanning... whether or not I have a listener is irrelevant. The fact that the hardware is constantly querying for nearby networks sounds pretty resource and battery intensive.

Is there anything one can do in this case without rooting?