A2DP Sink, AVRCP Controller and HFP Client in Android L

來源:互聯網
上載者:User

標籤: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 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.

著作權聲明:本文為博主原創文章,未經博主允許不得轉載。

A2DP Sink, AVRCP Controller and HFP Client in Android L

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.