标签:bluetooth a2dp sink hfp client avrcp controller
The APIs of A2DP sink, AVRCP controller and HFP client are not published in Android L, but the code which implements the profiles is indeed in Android L. You can set the configuration for the car to build the code.
版权声明:本文为博主原创文章,未经博主允许不得转载。
bluetooth HID dev, HFP client ,a2dp sink在android平台已经支持,下面做下简单说明:
在高通平台android4.4已经实现了a2dp sink,只要打开BTA_AVK_INCLUDED这个定义就可以启用a2dp sink的功能。
不过存在一个问题:在两个手机配对成功后,如果手机a主动连接手机b,那么手机a就会作为sourc端,断开连接后,如果b去主动连接a那么b就成为source端。
在5.0中 framework通过系统属性“persist.service.bt.a2dp.sink”在打开蓝牙时进行sink和source的判断,一旦确定角色就不会因为发起连接的不同而导致角色不同。
咋打开蓝牙时执行AdapterService.java::processStart->checkA2dpState(),根据系统属性把需要禁用的角色服务放到HashSet mDisabledProfiles中,然后启动需要的角色服务,然后启动其他需要启动的服务。
Bluedroid中通过BTA_AV_SINK_INCLUDED来控制a2dp sink功能的启用。