BR: Android - missing permissions for bluetoothMidi

When requesting bluetoothMidi permissions on Android, we’re finding that the Pixel 6 and Samsung S22 require both scan and connect permissions for our app. I’m not sure why this worked ok in the DemoRunner earlier this week but rigourous testing here shows a different story.

Please update the code to be as such:

        case RuntimePermissions::bluetoothMidi:
        {
            if (getAndroidSDKVersion() < 31)
                return { "android.permission.ACCESS_FINE_LOCATION" };

            return { "android.permission.BLUETOOTH_SCAN", "android.permission.BLUETOOTH_CONNECT" };
        }
1 Like

And with that, it would be an improvement if the permission for Bluetooth scanning were to be able to strongly assert that we aren’t using it for locations (or at least give us the option from the Projucer):

<!-- Include "neverForLocation" only if you can strongly assert that
         your app never derives physical location from Bluetooth scan results. -->
    <uses-permission android:name="android.permission.BLUETOOTH_SCAN"
                     android:usesPermissionFlags="neverForLocation" />

Please see this for details: Bluetooth permissions  |  Android Developers

This is getting tricky. I assumed it worked since they seem to belong to the same permission group so requesting one would grant you the group permission. And of course you need both, but I thought it was enough to request that from the manifest.

Out of curiousity: did you request both permissions in the Projucer when having the failed attempt?

It’s only downhill from here!

Well, we need both anyway seeing since the Orba 2’s BLE/MIDI connection involves scanning and connecting/reconnecting depending on the app’s state.

I did, yep.

Thank you for reporting.

1 Like