blob: b9fe0b2f951b44a8abe15dbc1e2e459c3894f157 [file] [log] [blame]
/*
* Copyright (C) 2018 The LineageOS Project
*
* SPDX-License-Identifier: Apache-2.0
*/
#include <android/binder_manager.h>
#include <android/binder_process.h>
#include "Light.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();
return EXIT_FAILURE; // should not reached
}