blob: c3d5f796df1102afd2206b2d6eae80ff44ddc08c [file] [log] [blame]
Alexander Koskovich5bee99d2021-08-01 21:40:55 -07001/*
2 * Copyright (C) 2020 The Android Open Source Project
3 * SPDX-License-Identifier: Apache-2.0
4 */
5
6#include "Lights.h"
7#include <android-base/logging.h>
8#include <android/binder_manager.h>
9#include <android/binder_process.h>
10
11using ::aidl::android::hardware::light::Lights;
12
13int main() {
14 ABinderProcess_setThreadPoolMaxThreadCount(0);
15 std::shared_ptr<Lights> lights = ndk::SharedRefBase::make<Lights>();
16 if (!lights) {
17 return EXIT_FAILURE;
18 }
19
20 const std::string instance = std::string() + Lights::descriptor + "/default";
21 binder_status_t status = AServiceManager_addService(lights->asBinder().get(), instance.c_str());
22 CHECK(status == STATUS_OK);
23
24 ABinderProcess_joinThreadPool();
25 return EXIT_FAILURE; // should not reached
26}