hardware_xiaomi/aidl/ir/service.cpp
Sebastiano Barezzi a271b57c99 Rewrite IR HAL in AIDL
Change-Id: Ie27056c065766ab802ee337ced921876726de5cb
2024-08-31 12:10:28 +00:00

25 lines
726 B
C++

/*
* SPDX-FileCopyrightText: 2024 The LineageOS Project
* SPDX-License-Identifier: Apache-2.0
*/
#include "ConsumerIr.h"
#include <android-base/logging.h>
#include <android/binder_manager.h>
#include <android/binder_process.h>
using aidl::android::hardware::ir::ConsumerIr;
int main() {
ABinderProcess_setThreadPoolMaxThreadCount(0);
std::shared_ptr<ConsumerIr> hal = ::ndk::SharedRefBase::make<ConsumerIr>();
const std::string instance = std::string(ConsumerIr::descriptor) + "/default";
binder_status_t status = AServiceManager_addService(hal->asBinder().get(), instance.c_str());
CHECK_EQ(status, STATUS_OK);
ABinderProcess_joinThreadPool();
return EXIT_FAILURE; // should not reach
}