Add the ability to specify bluetooth permission#2522
Add the ability to specify bluetooth permission#2522freakboy3742 merged 13 commits intobeeware:mainfrom
Conversation
|
Apologies, I'm not sure what's causing the build failures. If you can provide any hints or steps to reproduce the issue locally, I'd be happy to take a look and try to fix it. |
|
There was a significant AWS outage affecting Docker among many others. I re-ran the jobs for you. |
freakboy3742
left a comment
There was a problem hiding this comment.
Thanks for the PR. The implementation and tests for this look perfectly good for Android; but we need to do a little more investigation before we can accept this as a change in Briefcase.
Briefcase's top level configuration for permissions is explicitly cross platform. That means we need at least a cursory investigation into whether a simple bluetooth permission will be sufficient on other platforms - iOS, macOS, Windows, and Linux.
We don't necessarily need to you implement permissions for other platforms - but we need to know that we have sufficient granularity in our cross-platform permissions to capture the necessary features.
|
A few weeks ago I investigated a little regards bleak and briefcase on macOS and added some documetation in an bleak PR. I am also currently working on iOS support for bleak (see hbldh/bleak#1833). But it will take some time until I have tested the permissions with an iOS device. However, I think it will be very similar to macOS. AFAIK For Windows and Linux there is no similar permissions concept for bluetooth. |
Your position makes perfect sense. |
|
At the moment, I haven't found a straightforward way to use Bluetooth in a cross-platform manner with BeeWare, similar to how the GUI works with Toga. I've written separate experimental code snippets for Linux and Android. For Linux (and Windows), I used the python's socket implementation, while on Android I used objects from the "android.bluetooth" package. However, I haven't found a simple way to abstract this and write unified code that works across Linux, Windows, Android (and possibly iOS). |
At present, no. You're not the first person to ask about Bluetooth support, and it's an obvious area for a mobile app (or desktop app, for that matter) to support. However, I haven't done a lot of work with Bluetooth myself, so I don't have any particular advice to give. As you've noted, Bleak is usually the suggestion that comes up; but I haven't used it myself, and I'm aware that it doesn't offer an iOS solution at present (although evidently @timrid is looking into that). |
Thanks for your feedback! |
|
I just verified that bluetooth is working with iOS 26.1 on an iPhone 16 by using this branch hbldh/bleak#1853. For permission handling I had to add:
On macOS Sequoia 15.5 I had to add the same as on iOS:
|
freakboy3742
left a comment
There was a problem hiding this comment.
This looks good; I've flagged a couple issues related to documentation and an edge case of permissions handling.
The other detail: if we're going to fix the permission = False handling, we should also add a second changenote (2522.bugfix.md) that describes the fact that we're now handling permission disabling correctly.
|
Thanks for the feedback, I'll try to get to it next week |
freakboy3742
left a comment
There was a problem hiding this comment.
One tweak to documentation, plus the update to the template, and I think we'll be good to go!
freakboy3742
left a comment
There was a problem hiding this comment.
Thanks for those updates - this looks great!
Happy to contribute to this fantastic project and thank you for your valuable suggestions |


Add the ability to specify bluetooth permission for android
Allows you to specify the enabling of permissions for using Bluetooth on the Android device
Inspired by #1599
PR Checklist: