问题描述
1.蓝牙支持接收播放
2.蓝牙支持无PIN码连接(不需要弹出pin配对码请求弹窗)
3.蓝牙支持播放歌曲信息并应用层获取
解决方案:
1.a2dpsink-蓝牙需要支持接收播放补丁
1、device/rockchip/common/overlay/overlay/packages/apps/Bluetooth/res/values/config.xml
packages/apps/Bluetooth/overlay/packages/apps/Bluetooth/res/values/config.xml
+ <bool name="profile_supported_a2dp">false</bool>
+ <bool name="profile_supported_a2dp_sink">true</bool>
+ <bool name="a2dp_sink_automatically_request_audio_focus">true</bool>
+ <bool name="profile_supported_avrcp_controller">true</bool>
+ <bool name="a2dp_sink_automatically_request_audio_focus">true</bool>
2、system/bt/internal_include/bt_target.h
+//#ifndef BTA_AV_SINK_INCLUDED
+#define BTA_AV_SINK_INCLUDED TRUE
+//#endif
3、代码将enablenewavrcp关闭
hcq@ubuntu:~/11/system/bt$ grep "enablenewavrcp" -rnI
stack/avrc/avrc_api.cc:1119: bool is_new_avrcp = osi_property_get_bool("persist.bluetooth.enablenewavrcp", false);
btif/avrcp/avrcp_service.h:100: return osi_property_get_bool("persist.bluetooth.enablenewavrcp", false);
2.蓝牙支持无PIN码连接(不需要弹出pin配对码请求弹窗)
cd system/bt
diff --git a/btif/src/btif_core.cc b/btif/src/btif_core.cc
index aa77979..5109bae 100644
--- a/btif/src/btif_core.cc
++ b/btif/src/btif_core.cc
@ -915,7 +915,7 @ bt_status_t btif_set_adapter_property(const bt_property_t* property) {
bt_scan_mode_t mode = (bt_scan_mode_t)property->val;
tBTA_DM_DISC disc_mode;
tBTA_DM_CONN conn_mode;
mode = BT_SCAN_MODE_CONNECTABLE_DISCOVERABLE;
switch (mode) {
case BT_SCAN_MODE_NONE:
disc_mode = BTA_DM_NON_DISC;
3.蓝牙支持播放歌曲信息并应用层获取
播放歌曲信息在应用层获取 mediaController.getMetadata();, 这个网上有很多资料,参考一下附件
链接:https://pan.baidu.com/s/1DQlgXVKiEjbekZcoTDn5ng
提取码:3pyl