Niklas Dada
Niklas Dada

Reputation: 401

BluetoothSocket.connect() Android 12 Permission issue on certain devices

We use Bluetooth Low Energy L2CAP Channels (introduced in Android API Level 29) to transfer data to our BLE devices. Recently we've got reports that it's not working on this devices:

It turned out that when calling BluetoothSocket.connect() on the BluetoothSocket returned by createInsecureL2capChannel() these certain devices throw

java.lang.SecurityException: UID 10391 / PID 18566 lacks permission android.permission.BLUETOOTH

Declaring android.permission.BLUETOOTH in the manifest solves the problem.

But the documentation clearly says that only Manifest.permission.BLUETOOTH_CONNECT should be needed. And this expected behaviour could also be derived from the fact that in all other BLE scenarios android.permission.BLUETOOTH is never needed for API Level >= 31.

Is this a bug in the vendor-specific implementation of the Bluetooth stack? Are more devices/vendors are affected of this bug?

Upvotes: 2

Views: 802

Answers (0)

Related Questions