home-assistant / home-assistant/android
Use NEARBY_WIFI_DEVICES instead of ACCESS_FINE_LOCATION to enable WiFi queries
- Dominant language
- Kotlin
- Stars
- 3.9k
- Forks
- 1.1k
- Avg merge
- 1d 12h
- Merged PRs (30d)
- 81
Description
**Is your feature request related to a problem? Please describe.**
The Home Assistant app appears to require location permission to determine active Wi-Fi information (to inform as to whether the local network or external URL should be used. ) Use of this permission requires the device's location to be active.
**Describe the solution you'd like**
As of Android 13, an application can request an alternative permission, `NEARBY_WIFI_DEVICES`, to accomplish the same goal. This permission also doesn't require the devices location services to be active to perform Wi-Fi information requests. On devices running Android 12 and below, the location-based approach must still be used.
I implemented this once to scan networks to perform Wi-Fi direct transfers.... it has been working quite well in a production app. It also puts users at ease and is a more secure option (granting it does not allow actual reads of GPS-based location, only Wi-Fi information). The Play Store policy reasonably requires that information derived from `NEARBY_WIFI_DEVICES` never be used for purposes of determining actual location (e.g. using MAC address->latlong databases).
**Additional context**
Documentation for this new permission can be found here: https://developer.android.com/develop/connectivity/wifi/wifi-permissions
Contributor guide
Assessment
This issue has not been assessed yet.