Alexander Martinz | 6b59526 | 2024-09-02 11:18:25 +0200 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2017 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 | |
Alexander Martinz | 0b272c8 | 2024-09-02 11:21:59 +0200 | [diff] [blame] | 17 | #define LOG_TAG "android.hardware.biometrics.fingerprint@2.1-service.otter" |
Alexander Martinz | 6b59526 | 2024-09-02 11:18:25 +0200 | [diff] [blame] | 18 | |
| 19 | #include <android/log.h> |
| 20 | #include <hidl/HidlSupport.h> |
| 21 | #include <hidl/HidlTransportSupport.h> |
Han Sol Jin | 3f11734 | 2024-08-31 14:09:43 -0700 | [diff] [blame] | 22 | #include <android/hardware/biometrics/fingerprint/2.3/IBiometricsFingerprint.h> |
Alexander Martinz | 6b59526 | 2024-09-02 11:18:25 +0200 | [diff] [blame] | 23 | #include <android/hardware/biometrics/fingerprint/2.1/types.h> |
| 24 | #include "BiometricsFingerprint.h" |
| 25 | |
Han Sol Jin | 3f11734 | 2024-08-31 14:09:43 -0700 | [diff] [blame] | 26 | using android::hardware::biometrics::fingerprint::V2_3::IBiometricsFingerprint; |
| 27 | using android::hardware::biometrics::fingerprint::V2_3::implementation::BiometricsFingerprint; |
Alexander Martinz | 6b59526 | 2024-09-02 11:18:25 +0200 | [diff] [blame] | 28 | using android::hardware::configureRpcThreadpool; |
| 29 | using android::hardware::joinRpcThreadpool; |
| 30 | using android::sp; |
| 31 | |
| 32 | int main() { |
| 33 | android::sp<IBiometricsFingerprint> bio = BiometricsFingerprint::getInstance(); |
| 34 | |
| 35 | configureRpcThreadpool(1, true /*callerWillJoin*/); |
| 36 | |
| 37 | if (bio != nullptr) { |
| 38 | if (::android::OK != bio->registerAsService()) { |
| 39 | return 1; |
| 40 | } |
| 41 | } else { |
| 42 | ALOGE("Can't create instance of BiometricsFingerprint, nullptr"); |
| 43 | } |
| 44 | |
| 45 | joinRpcThreadpool(); |
| 46 | |
| 47 | return 0; // should never get here |
| 48 | } |