A2DP Sink, AVRCP Controller and HFP Client in Android L

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 added in /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.
  • 1
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 13
    评论
评论 13
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值