2021-09-22 05:29:46 -04:00
|
|
|
/*
|
|
|
|
* Copyright (C) 2021 The LineageOS Project
|
|
|
|
*
|
|
|
|
* SPDX-License-Identifier: Apache-2.0
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include "Lights.h"
|
|
|
|
|
2023-11-12 19:38:12 -05:00
|
|
|
#include <android-base/logging.h>
|
2021-09-22 05:29:46 -04:00
|
|
|
#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(status == STATUS_OK);
|
|
|
|
|
|
|
|
ABinderProcess_joinThreadPool();
|
2023-11-12 19:38:12 -05:00
|
|
|
return EXIT_FAILURE; // should not reach
|
2021-09-22 05:29:46 -04:00
|
|
|
}
|