blob: 73cdf0862511011bd2d4f322a8af262df41feb8e [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 Matyukhin66c64642021-03-23 22:33:31 -070037 ndk::ScopedAStatus enroll(const keymaster::HardwareAuthToken& hat,
Ilya Matyukhin26b20b92021-01-22 11:39:49 -080038 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(
Ilya Matyukhin66c64642021-03-23 22:33:31 -070043 int64_t keystoreOperationId,
Ilya Matyukhin09166982020-10-12 13:41:03 -070044 std::shared_ptr<common::ICancellationSignal>* returnVal) override;
45
46 ndk::ScopedAStatus detectInteraction(
Ilya Matyukhin66c64642021-03-23 22:33:31 -070047 std::shared_ptr<common::ICancellationSignal>* returnVal) override;
Ilya Matyukhin09166982020-10-12 13:41:03 -070048
Ilya Matyukhin66c64642021-03-23 22:33:31 -070049 ndk::ScopedAStatus enumerateEnrollments() override;
Ilya Matyukhin09166982020-10-12 13:41:03 -070050
Ilya Matyukhin66c64642021-03-23 22:33:31 -070051 ndk::ScopedAStatus removeEnrollments(const std::vector<int32_t>& enrollmentIds) override;
Ilya Matyukhin09166982020-10-12 13:41:03 -070052
Ilya Matyukhin66c64642021-03-23 22:33:31 -070053 ndk::ScopedAStatus getFeatures(int32_t enrollmentId) override;
Ilya Matyukhin26b20b92021-01-22 11:39:49 -080054
Ilya Matyukhin66c64642021-03-23 22:33:31 -070055 ndk::ScopedAStatus setFeature(const keymaster::HardwareAuthToken& hat, int32_t enrollmentId,
56 Feature feature, bool enabled) override;
Ilya Matyukhin26b20b92021-01-22 11:39:49 -080057
Ilya Matyukhin66c64642021-03-23 22:33:31 -070058 ndk::ScopedAStatus getAuthenticatorId() override;
Ilya Matyukhin09166982020-10-12 13:41:03 -070059
Ilya Matyukhin66c64642021-03-23 22:33:31 -070060 ndk::ScopedAStatus invalidateAuthenticatorId() override;
Ilya Matyukhin09166982020-10-12 13:41:03 -070061
Ilya Matyukhin66c64642021-03-23 22:33:31 -070062 ndk::ScopedAStatus resetLockout(const keymaster::HardwareAuthToken& hat) override;
Ilya Matyukhin09166982020-10-12 13:41:03 -070063
Ilya Matyukhin66c64642021-03-23 22:33:31 -070064 ndk::ScopedAStatus close() override;
Ilya Matyukhine52cae02021-02-17 16:38:56 -080065
Ilya Matyukhin09166982020-10-12 13:41:03 -070066 private:
67 std::shared_ptr<ISessionCallback> cb_;
68};
69
70} // namespace aidl::android::hardware::biometrics::face