android_device_peter_gsi/audio/hal/service.cpp
Peter Cai 94f2037c77 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-08-24 20:33:33 -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;
}