A2DP Sink, AVRCP Controller and HFP Client in Android L
2015-11-25 11:37
555 查看
收藏:0 [点我收藏+]
标签: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.
Where is the code?
A2DP sink/frameworks/base/core/java/android/bluetooth/BluetoothA2dpSink.java
/packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpSinkService.java
/packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpSinkStateMachine.java
/packages/apps/Bluetooth/jni/com_android_bluetooth_a2dp_sink.cpp
/hardware/libhardware/include/hardware/bt_av.h
AVRCP controller
/frameworks/base/core/java/android/bluetooth/BluetoothAvrcpController.java
/packages/apps/Bluetooth/src/com/android/bluetooth/avrcp/AvrcpControllerService.java
/packages/apps/Bluetooth/jni/com_android_bluetooth_avrcp_controller.cpp
HFP client
/frameworks/base/core/java/android/bluetooth/BluetoothHeadsetClient.java
/frameworks/base/core/java/android/bluetooth/BluetoothHeadsetClientCall.java
/packages/apps/Bluetooth/src/com/android/bluetooth/hfpclient/HeadsetClientHalConstants.java
/packages/apps/Bluetooth/src/com/android/bluetooth/hfpclient/HeadsetClientService.java
/packages/apps/Bluetooth/src/com/android/bluetooth/hfpclient/HeadsetClientStateMachine.java
/packages/apps/Bluetooth/jni/com_android_bluetooth_hfpclient.cpp
/hardware/libhardware/include/hardware/bt_hf_client.h
I does not list the files in bluedroid. You can find the files which are added or modified for A2DP sink, AVRCP controller and HFP client in the layers of BTIF, BTA and BTE(stack directory). An A2DP decoder locates in /external/bluetooth/bluedroid/embdrv/sbc/decoder/.
How to build the code?
Google develops A2DP sink, AVRCP controller and HFP client for Android Auto. car_hammerhead.mk is addedin /device/lge/hammerhead/.
You must add the product item ‘add_lunch_combo car_hammerhead-userdebug‘ in /device/lge/hammerhead/vendorsetup.sh. Then run ‘lunch‘, and select ‘car_hammerhead-userdebug‘. Now you can build the image of car_hammerhead and flash the image to Nexus 5.
You can used hcitool and sdptool to browse all available services on Nexus 5 with car_hammerhead image. You should see A2DP sink, AVRCP controller and HFP client in the list of available services. If you want to hear
the sound from the speaker of Nexus 5 with car_hammerhead image, you have to develop the App which uses A2DP sink APIs to trigger the audio routing from from BT stack to speaker. If no App registers a listener to bluedroid, the audio data will
be discarded before decoder.
a2dp sink 在android kk(4.4)和L(5.0)实现的区别
2015-03-05 15:28 898人阅读 评论(0) 收藏 举报分类:
bluetooth a2dp sink BT(7)
版权声明:本文为博主原创文章,未经博主允许不得转载。
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功能的启用。
相关文章推荐
- 优化Android Studio/Gradle构建
- Android工程项目解析
- 关于Android程序入口的猜想
- Android studio 上获取应用签名文件(keystore文件)的MD5值
- Android 中退出程序的几种方法
- 理解Android系统的进程间通信原理(二)----RPC机制
- Android性能专项测试之耗电量统计API
- Android SwipeToDismiss:左滑/右滑删除ListView条目Item
- Android 使用ViewPager自动滚动循环轮播效果
- 如何用Fiddler对Android应用进行抓包
- Android端百度地图API使用详解
- Android官方文档阅读之旅——Animation and Graphics Overview 动画与图形概述
- 初学使用android studio的NDK
- android 将时间戳转为代表"距现在多久之前"的字符串
- 几行代码,让你的 APP 变得花俏—Android Design Support Library 代码实验
- Android开发&Android studio中的jni
- 理解Android系统的进程间通信原理(一)----RPC中的代理模式
- Java课程设计笔记-Android系统创建阻塞式对话框
- Android系统性能调优工具介绍
- Android中常见的热门标签的流式布局的实现