From 8a7e77e7b953973e31df86a1f6eaf50d35aee65b Mon Sep 17 00:00:00 2001 From: Aniket Kumar Lata Date: Wed, 31 Jan 2018 20:17:30 -0800 Subject: [PATCH] audio: Register Bluetooth service with audio HAL Register Bluetooth audio library with audio HIDL service. Changes required for A2DP offload implementation. Bug: 68824150 Test: A2DP offload verified on supported codecs Change-Id: Idd89f0d28903579d42bd0f33b0194fb8dc2ceaaa Merged-In: Idd89f0d28903579d42bd0f33b0194fb8dc2ceaaa (cherry picked from commit c5a5203114b7696f5287c0ebada84b35df1be0f7) --- audio/2.0/default/Android.mk | 3 ++- audio/2.0/default/service.cpp | 8 ++++++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/audio/2.0/default/Android.mk b/audio/2.0/default/Android.mk index aa25077898..3587d60b07 100644 --- a/audio/2.0/default/Android.mk +++ b/audio/2.0/default/Android.mk @@ -80,7 +80,8 @@ LOCAL_SHARED_LIBRARIES := \ android.hardware.audio.effect@2.0 \ android.hardware.soundtrigger@2.0 \ android.hardware.broadcastradio@1.0 \ - android.hardware.broadcastradio@1.1 + android.hardware.broadcastradio@1.1 \ + android.hardware.bluetooth.a2dp@1.0 ifeq ($(strip $(AUDIOSERVER_MULTILIB)),) LOCAL_MULTILIB := 32 diff --git a/audio/2.0/default/service.cpp b/audio/2.0/default/service.cpp index a215108e95..29065234f8 100644 --- a/audio/2.0/default/service.cpp +++ b/audio/2.0/default/service.cpp @@ -16,11 +16,12 @@ #define LOG_TAG "audiohalservice" -#include -#include #include #include +#include #include +#include +#include using android::hardware::configureRpcThreadpool; using android::hardware::joinRpcThreadpool; @@ -30,6 +31,7 @@ using android::hardware::audio::effect::V2_0::IEffectsFactory; using android::hardware::audio::V2_0::IDevicesFactory; using android::hardware::soundtrigger::V2_0::ISoundTriggerHw; using android::hardware::registerPassthroughServiceImplementation; +using android::hardware::bluetooth::a2dp::V1_0::IBluetoothAudioOffload; using android::OK; @@ -43,6 +45,8 @@ int main(int /* argc */, char* /* argv */ []) { // Soundtrigger might be not present. status = registerPassthroughServiceImplementation(); ALOGE_IF(status != OK, "Error while registering soundtrigger service: %d", status); + status = registerPassthroughServiceImplementation(); + ALOGE_IF(status != OK, "Error while registering bluetooth_audio service: %d", status); joinRpcThreadpool(); return status; }