Steven Moreland | 9f8b5c7 | 2016-11-29 15:03:38 -0800 | [diff] [blame] | 1 | /* |
| 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 Moreland | 08484f8 | 2016-10-14 12:27:48 -0700 | [diff] [blame] | 16 | #define LOG_TAG "android.hardware.light@2.0-service" |
Steven Moreland | bd0db47 | 2016-11-03 08:32:56 -0700 | [diff] [blame] | 17 | |
Yifan Hong | f9d3034 | 2016-11-30 13:45:34 -0800 | [diff] [blame] | 18 | #include <android/log.h> |
Martijn Coenen | 0282237 | 2016-12-29 14:03:41 +0100 | [diff] [blame] | 19 | #include <hidl/HidlTransportSupport.h> |
Steven Moreland | 08484f8 | 2016-10-14 12:27:48 -0700 | [diff] [blame] | 20 | |
Steven Moreland | 08484f8 | 2016-10-14 12:27:48 -0700 | [diff] [blame] | 21 | #include "Light.h" |
| 22 | |
Martijn Coenen | 0282237 | 2016-12-29 14:03:41 +0100 | [diff] [blame] | 23 | using android::hardware::configureRpcThreadpool; |
| 24 | using android::hardware::joinRpcThreadpool; |
Steven Moreland | 08484f8 | 2016-10-14 12:27:48 -0700 | [diff] [blame] | 25 | using android::sp; |
| 26 | |
Steven Moreland | 08484f8 | 2016-10-14 12:27:48 -0700 | [diff] [blame] | 27 | // Generated HIDL files |
| 28 | using android::hardware::light::V2_0::ILight; |
| 29 | |
| 30 | int main() { |
Steven Moreland | 08484f8 | 2016-10-14 12:27:48 -0700 | [diff] [blame] | 31 | android::sp<ILight> service = new Light(); |
Martijn Coenen | 0282237 | 2016-12-29 14:03:41 +0100 | [diff] [blame] | 32 | configureRpcThreadpool(1, true /*callerWillJoin*/); |
Chris Phoenix | 074111d | 2017-01-25 12:48:51 -0800 | [diff] [blame^] | 33 | service->registerAsService(); |
Martijn Coenen | 0282237 | 2016-12-29 14:03:41 +0100 | [diff] [blame] | 34 | joinRpcThreadpool(); |
Steven Moreland | 08484f8 | 2016-10-14 12:27:48 -0700 | [diff] [blame] | 35 | } |