blob: 3eb7bdf0d6a743f9696e595859ae383268c80921 [file] [log] [blame]
Steven Moreland9f8b5c72016-11-29 15:03:38 -08001/*
2 * Copyright (C) 2016 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
Steven Moreland08484f82016-10-14 12:27:48 -070016#define LOG_TAG "android.hardware.light@2.0-service"
Steven Morelandbd0db472016-11-03 08:32:56 -070017
Yifan Hongf9d30342016-11-30 13:45:34 -080018#include <android/log.h>
Steven Moreland08484f82016-10-14 12:27:48 -070019
Steven Moreland08484f82016-10-14 12:27:48 -070020#include "Light.h"
21
22using android::sp;
23
24// libhwbinder:
25using android::hardware::IPCThreadState;
26using android::hardware::ProcessState;
27
28// Generated HIDL files
29using android::hardware::light::V2_0::ILight;
30
31int main() {
32 const char instance[] = "light";
33
34 android::sp<ILight> service = new Light();
35
36 service->registerAsService(instance);
37
38 ProcessState::self()->setThreadPoolMaxThreadCount(0);
39 ProcessState::self()->startThreadPool();
40 IPCThreadState::self()->joinThreadPool();
41}