diff options
Diffstat (limited to 'ir/service.cpp')
-rw-r--r-- | ir/service.cpp | 23 |
1 files changed, 19 insertions, 4 deletions
diff --git a/ir/service.cpp b/ir/service.cpp index 8e199ed..3af6202 100644 --- a/ir/service.cpp +++ b/ir/service.cpp @@ -6,12 +6,27 @@ #define LOG_TAG "android.hardware.ir@1.0-service" -#include <android/hardware/ir/1.0/IConsumerIr.h> -#include <hidl/LegacySupport.h> +#include <android-base/logging.h> +#include <hidl/HidlTransportSupport.h> +#include "ConsumerIr.h" using android::hardware::ir::V1_0::IConsumerIr; -using android::hardware::defaultPassthroughServiceImplementation; +using android::hardware::ir::V1_0::implementation::ConsumerIr; +using android::hardware::configureRpcThreadpool; +using android::hardware::joinRpcThreadpool; int main() { - return defaultPassthroughServiceImplementation<IConsumerIr>(); + android::sp<IConsumerIr> service = new ConsumerIr(); + + configureRpcThreadpool(1, true /*callerWillJoin*/); + + android::status_t status = service->registerAsService(); + if (status != android::OK) { + LOG(ERROR) << "Cannot register ConsumerIr service"; + return 1; + } + + joinRpcThreadpool(); + + return 1; // should never get here } |