startScan() in WifiManager deprecated in Android P

前端 未结 7 2087
没有蜡笔的小新
没有蜡笔的小新 2020-12-08 05:02

How to get scan result from wifi for example every 3 seconds, without mWifimanager.startScan();

Google says :

startScan() This method was

7条回答
  •  北海茫月
    2020-12-08 05:31

    Google has now documented the limitations for startScan() function in Android P:

    "We are further limiting the number of scans apps can request to improve network performance and improve battery life.

    The WifiManager.startScan() usage is limited to: - Each foreground app is restricted to 4 scans every 2 minutes. - All background apps combined are restricted to one scan every 30 minutes."

    Source: https://issuetracker.google.com/issues/79906367

    Edit 8-Aug-2018: Information has been added also here: https://developer.android.com/guide/topics/connectivity/wifi-scan#wifi-scan-throttling

提交回复
热议问题