blob: 934331638e4e8875926104ce56544086bfe7e1d5 [file] [log] [blame]
Ilya Matyukhin48ff8962021-02-22 13:13:13 -08001/*
2 * Copyright (C) 2021 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#pragma once
18
19#include <android-base/logging.h>
20
21namespace aidl::android::hardware::biometrics::fingerprint {
22
23class FakeFingerprintEngine {
24 public:
25 void generateChallengeImpl(ISessionCallback* cb, int32_t /*timeoutSec*/) {
26 LOG(INFO) << "generateChallengeImpl";
27 cb->onChallengeGenerated(0 /* challenge */);
28 }
29
30 void revokeChallengeImpl(ISessionCallback* cb, int64_t challenge) {
31 LOG(INFO) << "revokeChallengeImpl";
32 cb->onChallengeRevoked(challenge);
33 }
34
35 void enrollImpl(ISessionCallback* cb, const keymaster::HardwareAuthToken& /*hat*/) {
36 LOG(INFO) << "enrollImpl";
37 cb->onEnrollmentProgress(0 /* enrollmentId */, 0 /* remaining */);
38 }
39
40 void authenticateImpl(ISessionCallback* cb, int64_t /*operationId*/) {
41 LOG(INFO) << "authenticateImpl";
42 cb->onAuthenticationSucceeded(0 /* enrollmentId */, {} /* hat */);
43 }
44
45 void detectInteractionImpl(ISessionCallback* cb) {
46 LOG(INFO) << "detectInteractionImpl";
47 cb->onInteractionDetected();
48 }
49
50 void enumerateEnrollmentsImpl(ISessionCallback* cb) {
51 LOG(INFO) << "enumerateEnrollmentsImpl";
52 cb->onEnrollmentsEnumerated({} /* enrollmentIds */);
53 }
54
55 void removeEnrollmentsImpl(ISessionCallback* cb, const std::vector<int32_t>& enrollmentIds) {
56 LOG(INFO) << "removeEnrollmentsImpl";
57 cb->onEnrollmentsRemoved(enrollmentIds);
58 }
59
60 void getAuthenticatorIdImpl(ISessionCallback* cb) {
61 LOG(INFO) << "getAuthenticatorIdImpl";
62 cb->onAuthenticatorIdRetrieved(0 /* authenticatorId */);
63 }
64
65 void invalidateAuthenticatorIdImpl(ISessionCallback* cb) {
66 LOG(INFO) << "invalidateAuthenticatorIdImpl";
67 cb->onAuthenticatorIdInvalidated(0 /* newAuthenticatorId */);
68 }
69
70 void resetLockoutImpl(ISessionCallback* cb, const keymaster::HardwareAuthToken& /*hat*/) {
71 LOG(INFO) << "resetLockoutImpl";
72 cb->onLockoutCleared();
73 }
74};
75
76} // namespace aidl::android::hardware::biometrics::fingerprint