device_phh_treble/audio/hal/service.cpp
Peter Cai 4f1e4824dc gsi: sysbta: Separate audio interfaces from bluetooth
This will allow us to dynamically load multiple different versions of
audio interface implementation into the same sysbta hal process. Note
that since we are using a weird suffix here, the default
`registerPassthroughServiceImplementation` will not work, and we will
have to define our own dynamic symbol for it.
2022-10-04 16:27:57 -04:00

16 lines
578 B
C++

#include "DevicesFactory.h"
#include PATH(android/hardware/audio/FILE_VERSION/IDevicesFactory.h)
#include <hidl/Status.h>
using ::android::status_t;
using ::android::hardware::audio::CPP_VERSION::implementation::DevicesFactory;
using namespace ::android::hardware::audio::CPP_VERSION;
extern "C" __attribute__((visibility("default")))
status_t createIDevicesFactory(const char *instance_name) {
::android::sp<IDevicesFactory> audio_factory = new DevicesFactory();
::android::status_t hidl_status = audio_factory->registerAsService(instance_name);
return hidl_status;
}