blob: 1697c07282cfb2054d299d569270cce65275184d [file] [log] [blame]
Sasha Levitskiy965bd322016-10-21 10:55:25 -07001/*
Nick Desaulniers20105c82017-02-06 15:13:36 -08002 * Copyright (C) 2017 The Android Open Source Project
Sasha Levitskiy965bd322016-10-21 10:55:25 -07003 *
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"
18
Jim Miller902de512016-12-15 19:42:19 -080019#include <android/log.h>
20#include <hidl/HidlSupport.h>
21#include <hidl/HidlTransportSupport.h>
Sasha Levitskiy965bd322016-10-21 10:55:25 -070022#include <android/hardware/biometrics/fingerprint/2.1/IBiometricsFingerprint.h>
Jim Miller902de512016-12-15 19:42:19 -080023#include <android/hardware/biometrics/fingerprint/2.1/types.h>
24#include "BiometricsFingerprint.h"
Sasha Levitskiy965bd322016-10-21 10:55:25 -070025
26using android::hardware::biometrics::fingerprint::V2_1::IBiometricsFingerprint;
Jim Miller902de512016-12-15 19:42:19 -080027using android::hardware::biometrics::fingerprint::V2_1::implementation::BiometricsFingerprint;
28using android::hardware::configureRpcThreadpool;
29using android::hardware::joinRpcThreadpool;
30using android::sp;
Sasha Levitskiy965bd322016-10-21 10:55:25 -070031
32int main() {
Jim Miller902de512016-12-15 19:42:19 -080033 android::sp<IBiometricsFingerprint> bio = BiometricsFingerprint::getInstance();
34
35 configureRpcThreadpool(1, true /*callerWillJoin*/);
36
37 if (bio != nullptr) {
Yifan Hong4681ab82017-03-16 15:29:18 -070038 bio->registerAsService();
Jim Miller902de512016-12-15 19:42:19 -080039 } else {
40 ALOGE("Can't create instance of BiometricsFingerprint, nullptr");
41 }
42
43 joinRpcThreadpool();
44
45 return 0; // should never get here
Sasha Levitskiy965bd322016-10-21 10:55:25 -070046}