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
On API level >=26 use companion device pairing rather than the old BLE pairing API #14
Comments
Alas, in Android (at least for all recent releases - I don't remember
without checking the devdocs when they added this restriction): Because
being able to see bluetooth devices allows android apps (especially
'sneaky' apps that might be trying to secretly gleam information about
where the users is) conveys information to the app developer that might
reveal the user's location. From the docs:
The other permission that you must declare is ACCESS_FINE_LOCATION
<https://developer.android.com/reference/android/Manifest.permission#ACCESS_FINE_LOCATION>.
Your app needs this permission because a Bluetooth scan can be used to
gather information about the location of the user. This information may
come from the user's own devices, as well as Bluetooth beacons in use at
locations such as shops and transit facilities.
If the warning about requiring that location permission is not in there we
should add it back in. Because if we don't get it Android doesn't let us
access the bluetooth API.
…On Sun, Apr 12, 2020 at 3:41 PM Dafeman ***@***.***> wrote:
If location services are turned off then no devices are shown and you
cannot pair. In older app versions I think there was a warning about
needing both turned on but not in recent releases. If possible it would be
good not to require location services for boards that are equipped with GPS
already.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#14>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AABXB2ICLXTM2TV3YO6YUM3RMI7Q3ANCNFSM4MGSX7AQ>
.
|
Also your comment made me realize I made a big mistake in my latest
release. I suspect you will find it amusing. I'm rushing out a new build
to fix this:
51a1245
…On Sun, Apr 12, 2020 at 4:36 PM Kevin Hester ***@***.***> wrote:
Alas, in Android (at least for all recent releases - I don't remember
without checking the devdocs when they added this restriction): Because
being able to see bluetooth devices allows android apps (especially
'sneaky' apps that might be trying to secretly gleam information about
where the users is) conveys information to the app developer that might
reveal the user's location. From the docs:
> The other permission that you must declare is ACCESS_FINE_LOCATION
<https://developer.android.com/reference/android/Manifest.permission#ACCESS_FINE_LOCATION>.
Your app needs this permission because a Bluetooth scan can be used to
gather information about the location of the user. This information may
come from the user's own devices, as well as Bluetooth beacons in use at
locations such as shops and transit facilities.
If the warning about requiring that location permission is not in there we
should add it back in. Because if we don't get it Android doesn't let us
access the bluetooth API.
On Sun, Apr 12, 2020 at 3:41 PM Dafeman ***@***.***> wrote:
> If location services are turned off then no devices are shown and you
> cannot pair. In older app versions I think there was a warning about
> needing both turned on but not in recent releases. If possible it would be
> good not to require location services for boards that are equipped with GPS
> already.
>
> —
> You are receiving this because you are subscribed to this thread.
> Reply to this email directly, view it on GitHub
> <#14>, or
> unsubscribe
> <https://github.com/notifications/unsubscribe-auth/AABXB2ICLXTM2TV3YO6YUM3RMI7Q3ANCNFSM4MGSX7AQ>
> .
>
|
Ah right, seems overboard to require location be turned on just so the user is now aware that their location may be known when using BT! This may be useful for newer devices as it doesn't require location permissions. https://developer.android.com/guide/topics/connectivity/companion-device-pairing |
oh! that's great! Thanks for the link - I hadn't heard they added that. I'll repurpose this bug:
Companion device pairing doesn't create the connection to chosen devices. You use Bluetooth or Wi-Fi connectivity APIs to establish connections. Companion device pairing also isn't intended for continuous scanning. It is a means for implementing custom protocols over Bluetooth, BLE, and Wi-Fi that are required for the companion device to function. The requested permissions are granted when the user associates your app by selecting a device from the list. These permissions are revoked only if you call disassociate() or if the app is uninstalled. An app is responsible for clearing its own associations if the user no longer needs them, such as when they log out or remove bonded devices. |
Awesome, love your work! |
This issue has been mentioned on Meshtastic. There might be relevant details there: https://meshtastic.discourse.group/t/how-do-i-stop-the-android-app-properly/941/9 |
If location services are turned off then no devices are shown and you cannot pair. In older app versions I think there was a warning about needing both turned on but not in recent releases. If possible it would be good not to require location services for boards that are equipped with GPS already.
The text was updated successfully, but these errors were encountered: