blob: 0651726d0a529928af3219450102e788793c74c9 [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
Ilya Matyukhine5034812020-10-15 21:45:56 -070033 ndk::ScopedAStatus generateChallenge(int32_t cookie, int32_t timeoutSec) override;
Ilya Matyukhin09166982020-10-12 13:41:03 -070034
Ilya Matyukhine5034812020-10-15 21:45:56 -070035 ndk::ScopedAStatus revokeChallenge(int32_t cookie, int64_t challenge) override;
Ilya Matyukhin09166982020-10-12 13:41:03 -070036
Ilya Matyukhin26b20b92021-01-22 11:39:49 -080037 ndk::ScopedAStatus enroll(int32_t cookie, const keymaster::HardwareAuthToken& hat,
38 EnrollmentType enrollmentType, const std::vector<Feature>& features,
39 const NativeHandle& previewSurface,
40 std::shared_ptr<common::ICancellationSignal>* return_val) override;
Ilya Matyukhin09166982020-10-12 13:41:03 -070041
42 ndk::ScopedAStatus authenticate(
43 int32_t cookie, int64_t keystoreOperationId,
44 std::shared_ptr<common::ICancellationSignal>* returnVal) override;
45
46 ndk::ScopedAStatus detectInteraction(
47 int32_t cookie, std::shared_ptr<common::ICancellationSignal>* returnVal) override;
48
49 ndk::ScopedAStatus enumerateEnrollments(int32_t cookie) override;
50
51 ndk::ScopedAStatus removeEnrollments(int32_t cookie,
52 const std::vector<int32_t>& enrollmentIds) override;
53
Ilya Matyukhin26b20b92021-01-22 11:39:49 -080054 ndk::ScopedAStatus getFeatures(int32_t cookie, int32_t enrollmentId) override;
55
56 ndk::ScopedAStatus setFeature(int32_t cookie, const keymaster::HardwareAuthToken& hat,
57 int32_t enrollmentId, Feature feature, bool enabled) override;
58
Ilya Matyukhin09166982020-10-12 13:41:03 -070059 ndk::ScopedAStatus getAuthenticatorId(int32_t cookie) override;
60
61 ndk::ScopedAStatus invalidateAuthenticatorId(int32_t cookie) override;
62
63 ndk::ScopedAStatus resetLockout(int32_t cookie,
64 const keymaster::HardwareAuthToken& hat) override;
65
Ilya Matyukhine52cae02021-02-17 16:38:56 -080066 ndk::ScopedAStatus close(int32_t cookie) override;
67
Ilya Matyukhin09166982020-10-12 13:41:03 -070068 private:
69 std::shared_ptr<ISessionCallback> cb_;
70};
71
72} // namespace aidl::android::hardware::biometrics::face