Ilya Matyukhin | 0916698 | 2020-10-12 13:41:03 -0700 | [diff] [blame] | 1 | /* |
| 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 | |
| 22 | namespace aidl::android::hardware::biometrics::face { |
| 23 | |
| 24 | namespace common = aidl::android::hardware::biometrics::common; |
| 25 | namespace keymaster = aidl::android::hardware::keymaster; |
| 26 | |
| 27 | using aidl::android::hardware::common::NativeHandle; |
| 28 | |
| 29 | class Session : public BnSession { |
| 30 | public: |
| 31 | explicit Session(std::shared_ptr<ISessionCallback> cb); |
| 32 | |
Ilya Matyukhin | e503481 | 2020-10-15 21:45:56 -0700 | [diff] [blame] | 33 | ndk::ScopedAStatus generateChallenge(int32_t cookie, int32_t timeoutSec) override; |
Ilya Matyukhin | 0916698 | 2020-10-12 13:41:03 -0700 | [diff] [blame] | 34 | |
Ilya Matyukhin | e503481 | 2020-10-15 21:45:56 -0700 | [diff] [blame] | 35 | ndk::ScopedAStatus revokeChallenge(int32_t cookie, int64_t challenge) override; |
Ilya Matyukhin | 0916698 | 2020-10-12 13:41:03 -0700 | [diff] [blame] | 36 | |
Ilya Matyukhin | 26b20b9 | 2021-01-22 11:39:49 -0800 | [diff] [blame^] | 37 | 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 Matyukhin | 0916698 | 2020-10-12 13:41:03 -0700 | [diff] [blame] | 41 | |
| 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 Matyukhin | 26b20b9 | 2021-01-22 11:39:49 -0800 | [diff] [blame^] | 54 | 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 Matyukhin | 0916698 | 2020-10-12 13:41:03 -0700 | [diff] [blame] | 59 | 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 | |
| 66 | private: |
| 67 | std::shared_ptr<ISessionCallback> cb_; |
| 68 | }; |
| 69 | |
| 70 | } // namespace aidl::android::hardware::biometrics::face |