kshoji / BLE-HID-Peripheral-for-Android

BLE HID over GATT Profile for Android
Apache License 2.0
239 stars 76 forks source link

Need BLUETOOTH PRIVILEGED permission #14

Open fbiego opened 4 years ago

fbiego commented 4 years ago
D/HidPeripheral: Need BLUETOOTH PRIVILEGED permission: Neither user 10152 nor current process has android.permission.BLUETOOTH_PRIVILEGED.
    java.lang.SecurityException: Need BLUETOOTH PRIVILEGED permission: Neither user 10152 nor current process has android.permission.BLUETOOTH_PRIVILEGED.
        at android.os.Parcel.readException(Parcel.java:1683)
        at android.os.Parcel.readException(Parcel.java:1636)
        at android.bluetooth.IBluetooth$Stub$Proxy.setPairingConfirmation(IBluetooth.java:1616)
        at android.bluetooth.BluetoothDevice.setPairingConfirmation(BluetoothDevice.java:1273)
        at jp.kshoji.blehid.HidPeripheral$5.onConnectionStateChange(HidPeripheral.java:609)
        at android.bluetooth.BluetoothGattServer$1.onServerConnectionState(BluetoothGattServer.java:105)
        at android.bluetooth.IBluetoothGattServerCallback$Stub.onTransact(IBluetoothGattServerCallback.java:82)
        at android.os.Binder.execTransact(Binder.java:570)

Android docs says 'Not for use by third-party applications.' BLUETOOTH PRIVILEGED

How do I make it work?

tobiasBora commented 4 years ago

Not sure, but this suggest that it's possible to add it via adb https://github.com/kshoji/BLE-HID-Peripheral-for-Android/issues/8

iroidzeel commented 4 years ago

Im trying to use this app but nothing happens no crash logs and nothing how did you get this BLUETOOTH PRIVILEGED issue?

it is working now for you?

fbiego commented 3 years ago

happens during pairing because setPairingConfirmation(true) requires BLUETOOTH PRIVILEGED. Even after granting the permission by installing as a system app, pairing fails #1