2023-10-29 22:23:08 +01:00
|
|
|
/*
|
2024-06-23 17:34:42 +02:00
|
|
|
* SPDX-FileCopyrightText: 2020 The Android Open Source Project
|
2023-10-29 22:23:08 +01:00
|
|
|
* 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>();
|
|
|
|
if (!lights) {
|
|
|
|
return EXIT_FAILURE;
|
|
|
|
}
|
|
|
|
|
|
|
|
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();
|
|
|
|
return EXIT_FAILURE; // should not be reached
|
|
|
|
}
|