(Had to delete links . Chopped it up a bit. This is on developer site
Permissions
Note: In each of the following sections that mention location permissions or location-gathering logic, keep in mind that, when your app is running in the background, access to location should be critical to the core functionality of the app and is accompanied with proper disclosure to users
Android 8.0 and Android 8.1:
A successful call to WifiManager.getScanResults() requires any one of the following permissions:
ACCESS_FINE_LOCATION
ACCESS_COARSE_LOCATION
CHANGE_WIFI_STATE
If the calling app does not have any of these permissions, the call fails with a SecurityException.
Alternatively, on devices
Alternatively, on devices running Android 8.0 (API level 26) and higher, you can use the CompanionDeviceManager
to perform a scan of nearby companion devices on behalf of your app without requiring the location permission. For more on this option, see [Companion device pairing](
guide/topics/connectivity/companion-device-pairing).
Android 9:
A successful call to [ WifiManager.startScan()
]
eference/android/net/wifi/WifiManager#startScan()) requires all of the following conditions to be met:
permission.
- Your app has the [
CHANGE_WIFI_STATE
]
m/reference/android/Manifest.permission#CHANGEE) permission.
- Location services are enabled on the device (under Settings > Location
Android 10 (API level 29) and higher:
A successful call to