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 c5a5203114)
This commit is contained in:
Aniket Kumar Lata
2018-01-31 20:17:30 -08:00
committed by Pavlin Radoslavov
parent 9526c2ff73
commit 8a7e77e7b9
2 changed files with 8 additions and 3 deletions

View File

@@ -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

View File

@@ -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::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<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;
}