1.首先A10 的kernel 没有把usb 蓝牙的驱动打开
配置内核支持Bluetooth,
1.1 make menuconfig
[*] Networking support
<*>
<*>
<*>
<*>
[*]
<*>
[*]
[*]
<*>
Bluetooth device drivers
<*> HCI USB driver
<M>HCI UART driver
<*> HCI BlueFRITZ! USB driver
<*> HCI VHCI (Virtual HCI device) driver
2.android层:
2.1加bluetooth权限:在/device/softwinner/crane-common/ProductCommon.mk
frameworks/base/data/etc/android.hardware.bluetooth.xml:system/etc/permissions/android.hardware.bluetooth.xml
在android.hardware.bluetooth.xml:
<permissions>
<feature name="android.hardware.bluetooth" />
</permissions>
2.2加usb host权限
frameworks/base/data/etc/android.hardware.usb.host.xml:system/etc/permissions/android.hardware.usb.host.xml
在android.hardware.usb.host.xml 里写:
<permissions>
<feature name="android.hardware.usb.host" />
</permissions>
2.3 在/device/softwinner/crane-common/tablet_core_hardware.xml:
<feature name="android.hardware.bluetooth" />
<feature name="android.hardware.usb.host" />
3.init.sun4i.rc
# change rfkill permissions for bluetooth power management
chmod 0666 /sys/class/rfkill/rfkill0/state
chmod 0666 /sys/class/rfkill/rfkill0/type
chown bluetooth bluetooth /sys/class/rfkill/rfkill0/state
chown bluetooth bluetooth /sys/class/rfkill/rfkill0/type
write /sys/class/rfkill/rfkill0/state 0
setprop rw.bluetooth.status "0"
4.device\softwinner\apollo-mele\BoardConfig.mk
BOARD_HAVE_BLUETOOTH := true
5.蓝牙设备默认名字修改:external\bluetooth\bluez\src\main.c下
static void init_defaults(void)
{
/* Default HCId settings */
memset(&main_opts, 0, sizeof(main_opts));
main_opts.mode= MODE_CONNECTABLE;
main_opts.name= g_strdup("BlueZ");
....
把BlueZ 改成你想要改成的名字就行了。