Files
android_device_essential_mata/light/service.cpp
Michael Bestas 74db3178db mata: Migrate light HAL from HIDL to AIDL
Change-Id: I8d861846af89724050fba5159e0fb7983d04222f
2024-07-16 22:12:27 +02:00

25 lines
723 B
C++

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