blob: caf81f870267c3152d8871dec724445cb0cd3b42 [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 Matyukhin66c64642021-03-23 22:33:31 -070033 ndk::ScopedAStatus generateChallenge() override;
Ilya Matyukhin09166982020-10-12 13:41:03 -070034
Ilya Matyukhin66c64642021-03-23 22:33:31 -070035 ndk::ScopedAStatus revokeChallenge(int64_t challenge) override;
Ilya Matyukhin09166982020-10-12 13:41:03 -070036
Ilya Matyukhin929146e2021-04-22 00:29:01 -070037 ndk::ScopedAStatus getEnrollmentConfig(EnrollmentType enrollmentType,
38 std::vector<EnrollmentStageConfig>* return_val) override;
39
Ilya Matyukhin66c64642021-03-23 22:33:31 -070040 ndk::ScopedAStatus enroll(const keymaster::HardwareAuthToken& hat,
Ilya Matyukhin26b20b92021-01-22 11:39:49 -080041 EnrollmentType enrollmentType, const std::vector<Feature>& features,
42 const NativeHandle& previewSurface,
43 std::shared_ptr<common::ICancellationSignal>* return_val) override;
Ilya Matyukhin09166982020-10-12 13:41:03 -070044
45 ndk::ScopedAStatus authenticate(
Ilya Matyukhin66c64642021-03-23 22:33:31 -070046 int64_t keystoreOperationId,
Ilya Matyukhin09166982020-10-12 13:41:03 -070047 std::shared_ptr<common::ICancellationSignal>* returnVal) override;
48
49 ndk::ScopedAStatus detectInteraction(
Ilya Matyukhin66c64642021-03-23 22:33:31 -070050 std::shared_ptr<common::ICancellationSignal>* returnVal) override;
Ilya Matyukhin09166982020-10-12 13:41:03 -070051
Ilya Matyukhin66c64642021-03-23 22:33:31 -070052 ndk::ScopedAStatus enumerateEnrollments() override;
Ilya Matyukhin09166982020-10-12 13:41:03 -070053
Ilya Matyukhin66c64642021-03-23 22:33:31 -070054 ndk::ScopedAStatus removeEnrollments(const std::vector<int32_t>& enrollmentIds) override;
Ilya Matyukhin09166982020-10-12 13:41:03 -070055
Ilya Matyukhin9fcf6b12021-04-14 13:43:06 -070056 ndk::ScopedAStatus getFeatures() override;
Ilya Matyukhin26b20b92021-01-22 11:39:49 -080057
Ilya Matyukhin9fcf6b12021-04-14 13:43:06 -070058 ndk::ScopedAStatus setFeature(const keymaster::HardwareAuthToken& hat, Feature feature,
59 bool enabled) override;
Ilya Matyukhin26b20b92021-01-22 11:39:49 -080060
Ilya Matyukhin66c64642021-03-23 22:33:31 -070061 ndk::ScopedAStatus getAuthenticatorId() override;
Ilya Matyukhin09166982020-10-12 13:41:03 -070062
Ilya Matyukhin66c64642021-03-23 22:33:31 -070063 ndk::ScopedAStatus invalidateAuthenticatorId() override;
Ilya Matyukhin09166982020-10-12 13:41:03 -070064
Ilya Matyukhin66c64642021-03-23 22:33:31 -070065 ndk::ScopedAStatus resetLockout(const keymaster::HardwareAuthToken& hat) override;
Ilya Matyukhin09166982020-10-12 13:41:03 -070066
Ilya Matyukhin66c64642021-03-23 22:33:31 -070067 ndk::ScopedAStatus close() override;
Ilya Matyukhine52cae02021-02-17 16:38:56 -080068
Ilya Matyukhin09166982020-10-12 13:41:03 -070069 private:
70 std::shared_ptr<ISessionCallback> cb_;
71};
72
73} // namespace aidl::android::hardware::biometrics::face