Steven Moreland | 08484f8 | 2016-10-14 12:27:48 -0700 | [diff] [blame] | 1 | #define LOG_TAG "android.hardware.light@2.0-service" |
Steven Moreland | bd0db47 | 2016-11-03 08:32:56 -0700 | [diff] [blame] | 2 | |
Steven Moreland | 08484f8 | 2016-10-14 12:27:48 -0700 | [diff] [blame] | 3 | #include <utils/Log.h> |
| 4 | |
Steven Moreland | 08484f8 | 2016-10-14 12:27:48 -0700 | [diff] [blame] | 5 | #include "Light.h" |
| 6 | |
| 7 | using android::sp; |
| 8 | |
| 9 | // libhwbinder: |
| 10 | using android::hardware::IPCThreadState; |
| 11 | using android::hardware::ProcessState; |
| 12 | |
| 13 | // Generated HIDL files |
| 14 | using android::hardware::light::V2_0::ILight; |
| 15 | |
| 16 | int main() { |
| 17 | const char instance[] = "light"; |
| 18 | |
| 19 | android::sp<ILight> service = new Light(); |
| 20 | |
| 21 | service->registerAsService(instance); |
| 22 | |
| 23 | ProcessState::self()->setThreadPoolMaxThreadCount(0); |
| 24 | ProcessState::self()->startThreadPool(); |
| 25 | IPCThreadState::self()->joinThreadPool(); |
| 26 | } |