Android WifiManager and Scanning Battery Performance

僤鯓⒐⒋嵵緔 提交于 2019-12-23 08:25:14

问题


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?

来源:https://stackoverflow.com/questions/29390414/android-wifimanager-and-scanning-battery-performance

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!