blob: d3fb4dee99caadc0e0f1e30f4d128c84d443e180 [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>
Martijn Coenen02822372016-12-29 14:03:41 +010019#include <hidl/HidlTransportSupport.h>
Steven Moreland08484f82016-10-14 12:27:48 -070020
Steven Moreland08484f82016-10-14 12:27:48 -070021#include "Light.h"
22
Martijn Coenen02822372016-12-29 14:03:41 +010023using android::hardware::configureRpcThreadpool;
24using android::hardware::joinRpcThreadpool;
Steven Moreland08484f82016-10-14 12:27:48 -070025using android::sp;
26
Steven Moreland08484f82016-10-14 12:27:48 -070027// Generated HIDL files
28using android::hardware::light::V2_0::ILight;
29
30int main() {
31 const char instance[] = "light";
32
33 android::sp<ILight> service = new Light();
Martijn Coenen02822372016-12-29 14:03:41 +010034 configureRpcThreadpool(1, true /*callerWillJoin*/);
Steven Moreland08484f82016-10-14 12:27:48 -070035 service->registerAsService(instance);
Martijn Coenen02822372016-12-29 14:03:41 +010036 joinRpcThreadpool();
Steven Moreland08484f82016-10-14 12:27:48 -070037}