blob: 09d511156913a4a9e648641333eed7b9a714e8dc [file] [log] [blame]
Jan Altensen1813ff92019-08-20 23:20:25 +02001/*
2 * Copyright (C) 2019 The LineageOS 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.fingerprint@2.1-service.samsung"
18
19#include <android-base/logging.h>
20#include <hidl/HidlTransportSupport.h>
21#include <utils/Errors.h>
22
23#include "BiometricsFingerprint.h"
24
25using android::hardware::configureRpcThreadpool;
26using android::hardware::joinRpcThreadpool;
27
28using android::hardware::biometrics::fingerprint::V2_1::IBiometricsFingerprint;
29using android::hardware::biometrics::fingerprint::V2_1::implementation::BiometricsFingerprint;
30
31using android::OK;
32using android::sp;
33
34int main() {
35 android::sp<IBiometricsFingerprint> bio = BiometricsFingerprint::getInstance();
36
37 configureRpcThreadpool(1, true);
38
39 if (bio == nullptr || bio->registerAsService() != OK) {
40 LOG(ERROR) << "Could not register service for Fingerprint HAL";
41 goto shutdown;
42 }
43
44 LOG(INFO) << "Fingerprint HAL service is Ready.";
45 joinRpcThreadpool();
46
47shutdown:
48 // In normal operation, we don't expect the thread pool to shutdown
49 LOG(ERROR) << "Fingerprint HAL failed to join thread pool.";
50 return 1;
51}