Ilya Matyukhin | 366cc53 | 2020-01-17 22:45:44 -0800 | [diff] [blame^] | 1 | /* |
| 2 | * Copyright (C) 2020 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 | */ |
| 16 | |
| 17 | #define LOG_TAG "android.hardware.biometrics.face@1.1-service" |
| 18 | |
| 19 | #include <android/hardware/biometrics/face/1.0/types.h> |
| 20 | #include <android/hardware/biometrics/face/1.1/IBiometricsFace.h> |
| 21 | #include <android/log.h> |
| 22 | #include <hidl/HidlSupport.h> |
| 23 | #include <hidl/HidlTransportSupport.h> |
| 24 | #include "BiometricsFace.h" |
| 25 | |
| 26 | using android::sp; |
| 27 | using android::hardware::configureRpcThreadpool; |
| 28 | using android::hardware::joinRpcThreadpool; |
| 29 | using android::hardware::biometrics::face::implementation::BiometricsFace; |
| 30 | using android::hardware::biometrics::face::V1_1::IBiometricsFace; |
| 31 | |
| 32 | int main() { |
| 33 | ALOGI("BiometricsFace HAL is being started."); |
| 34 | |
| 35 | configureRpcThreadpool(1, true /*callerWillJoin*/); |
| 36 | |
| 37 | android::sp<IBiometricsFace> face = new BiometricsFace(); |
| 38 | const android::status_t status = face->registerAsService(); |
| 39 | |
| 40 | if (status != android::OK) { |
| 41 | ALOGE("Error starting the BiometricsFace HAL."); |
| 42 | return 1; |
| 43 | } |
| 44 | |
| 45 | ALOGI("BiometricsFace HAL has started successfully."); |
| 46 | joinRpcThreadpool(); |
| 47 | |
| 48 | ALOGI("BiometricsFace HAL is terminating."); |
| 49 | return 1; // should never get here |
| 50 | } |