Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use NEARBY_WIFI_DEVICES instead of ACCESS_FINE_LOCATION to enable WiFi queries #4968

Open
tliebeck opened this issue Jan 11, 2025 · 1 comment
Labels
enhancement New feature or request

Comments

@tliebeck
Copy link

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

@tliebeck tliebeck added the enhancement New feature or request label Jan 11, 2025
@dshokouhi
Copy link
Member

as the app still uses wifi to determine location for URL switching we still need location permission: https://developer.android.com/develop/connectivity/wifi/wifi-permissions#wifi-access-workflows

the other major issue is that the app no longer gets intents and the scanning then needs to happen in the background so it wont be as instant as it was.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants