blob: a91ad8151ba0ade815ac3a483c99b03bd40e29d0 [file] [log] [blame]
Ilya Matyukhin09166982020-10-12 13:41:03 -07001/*
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#pragma once
18
19#include <aidl/android/hardware/biometrics/face/BnSession.h>
20#include <aidl/android/hardware/biometrics/face/ISessionCallback.h>
21
22namespace aidl::android::hardware::biometrics::face {
23
24namespace common = aidl::android::hardware::biometrics::common;
25namespace keymaster = aidl::android::hardware::keymaster;
26
27using aidl::android::hardware::common::NativeHandle;
28
29class Session : public BnSession {
30 public:
31 explicit Session(std::shared_ptr<ISessionCallback> cb);
32
33 ndk::ScopedAStatus generateChallenge(int32_t cookie, int32_t sensorId, int32_t userId,
34 int32_t timeoutSec) override;
35
36 ndk::ScopedAStatus revokeChallenge(int32_t cookie, int32_t sensorId, int32_t userId,
37 int64_t challenge) override;
38
39 ndk::ScopedAStatus enroll(
40 int32_t cookie, const keymaster::HardwareAuthToken& hat,
41 const NativeHandle& previewSurface,
42 std::shared_ptr<biometrics::common::ICancellationSignal>* returnVal) override;
43
44 ndk::ScopedAStatus authenticate(
45 int32_t cookie, int64_t keystoreOperationId,
46 std::shared_ptr<common::ICancellationSignal>* returnVal) override;
47
48 ndk::ScopedAStatus detectInteraction(
49 int32_t cookie, std::shared_ptr<common::ICancellationSignal>* returnVal) override;
50
51 ndk::ScopedAStatus enumerateEnrollments(int32_t cookie) override;
52
53 ndk::ScopedAStatus removeEnrollments(int32_t cookie,
54 const std::vector<int32_t>& enrollmentIds) override;
55
56 ndk::ScopedAStatus getAuthenticatorId(int32_t cookie) override;
57
58 ndk::ScopedAStatus invalidateAuthenticatorId(int32_t cookie) override;
59
60 ndk::ScopedAStatus resetLockout(int32_t cookie,
61 const keymaster::HardwareAuthToken& hat) override;
62
63 private:
64 std::shared_ptr<ISessionCallback> cb_;
65};
66
67} // namespace aidl::android::hardware::biometrics::face