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)
diff --git a/audio/2.0/default/Android.mk b/audio/2.0/default/Android.mk
index aa25077..3587d60 100644
--- a/audio/2.0/default/Android.mk
+++ b/audio/2.0/default/Android.mk
@@ -80,7 +80,8 @@
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 a215108..2906523 100644
--- a/audio/2.0/default/service.cpp
+++ b/audio/2.0/default/service.cpp
@@ -16,11 +16,12 @@
#define LOG_TAG "audiohalservice"
-#include <hidl/HidlTransportSupport.h>
-#include <hidl/LegacySupport.h>
#include <android/hardware/audio/2.0/IDevicesFactory.h>
#include <android/hardware/audio/effect/2.0/IEffectsFactory.h>
+#include <android/hardware/bluetooth/a2dp/1.0/IBluetoothAudioOffload.h>
#include <android/hardware/soundtrigger/2.0/ISoundTriggerHw.h>
+#include <hidl/HidlTransportSupport.h>
+#include <hidl/LegacySupport.h>
using android::hardware::configureRpcThreadpool;
using android::hardware::joinRpcThreadpool;
@@ -30,6 +31,7 @@
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 @@
// Soundtrigger might be not present.
status = registerPassthroughServiceImplementation<ISoundTriggerHw>();
ALOGE_IF(status != OK, "Error while registering soundtrigger service: %d", status);
+ status = registerPassthroughServiceImplementation<IBluetoothAudioOffload>();
+ ALOGE_IF(status != OK, "Error while registering bluetooth_audio service: %d", status);
joinRpcThreadpool();
return status;
}