确保底层kernel已经配置好了,那么就用logcat打印日志
09-16 10:00:03.798 927 944 I bt_osi_thread: run_thread: thread id 944, thread name stack_manager started
09-16 10:00:03.798 927 944 I bt_stack_manager: event_init_stack is initializing the stack
09-16 10:00:03.799 927 944 E : [0916/100003.799297:ERROR:config.cc(74)] config_new: unable to open file '/data/misc/bluedroid/bt_config.conf': No such file or directory
09-16 10:00:03.799 927 944 W bt_btif_config: init unable to load config file: /data/misc/bluedroid/bt_config.conf; using backup.
09-16 10:00:03.799 927 944 E : [0916/100003.799474:ERROR:config.cc(74)] config_new: unable to open file '/data/misc/bluedroid/bt_config.bak': No such file or directory
09-16 10:00:03.799 927 944 W bt_btif_config: init unable to load backup; attempting to transcode legacy file.
09-16 10:00:03.799 927 944 E bt_btif_config_transcode: btif_config_transcode unable to load XML file '/data/misc/bluedroid/bt_config.xml': 3
09-16 10:00:03.799 927 944 E bt_btif_config: init unable to transcode legacy file; creating empty config.
09-16 10:00:03.800 927 944 E bt_osi_alarm: timer_create_internal unable to create timer with clock 9: Unknown error 524
09-16 10:00:03.800 927 944 E bt_osi_alarm: The kernel might not have support for timer_create(CLOCK_BOOTTIME_ALARM): https://lwn.net/Articles/429925/
09-16 10:00:03.800 927 944 E bt_osi_alarm: See following patches: https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/log/?qt=grep&q=CLOCK_BOOTTIME_ALARM
09-16 10:00:03.800 927 944 F : [0916/100003.800342:FATAL:alarm.cc(179)] Check failed: false.
09-16 10:00:03.800 927 944 F libc : Fatal signal 6 (SIGABRT), code -6 (SI_TKILL) in tid 944 (stack_manager), pid 927 (droid.bluetooth)
sdk-9.0\system\bt\osi\src\alarm.cc文件报错,于是修改
#define KERNEL_MISSING_CLOCK_BOOTTIME_ALARM TRUE / add by wugk /
#if (KERNEL_MISSING_CLOCK_BOOTTIME_ALARM == TRUE)
蓝牙就可以工作了。
原作者:Mr.云舒