Hi everyone, the following patches make bluetooth functional to all generic usb bluetooth devices and one more specific (Realtek 8723AU) which my tablet have.
To make this work the bluetooth required permissions to access usb device. (I don't know much about permissions on android. If I did something bad please tell me)
This is needed because our bluetooth is using a module created by broadcom which allow generic usb bluetooth to work as a main bluetooth device for android.
Inside this module it's used libusb to open and read usb devices, that's why usb permissions are needed.
Path to apply.
external/bluetooth/bluedroid
0001-bluedroid-add-new-usb-bluetooth-device
packages/apps/Bluetooth
0001-bluetooth-add-permission-to-access-usb-devices
init.sh
0001-bluetooth-disable-rfkill-for-usb-bluetooth
frameworks/base
0001-permissions-associate-android.permission.USB_ACCESS-
0001-usb-add-new-permission-to-grant-access-to-usb-device
This was tested on android kitkat and lollipop, working on both.
File transfer and my bluetooth keyboard are working perfectly. (This is what I have to test).
There's a few little bugs:
*To disable bluetooth is needed to turn it off using settings menu and then use command "am force-stop com.android.bluetooth" a few times. (only on kitkat version)
*When you enable bluetooth it may start restarting until something is paired/connected. (both versions)
*For some reason when I try to pair/transfer to my tablet, my phone shows me the name of my bluetooth on windows. (only on lollipop version)