blob: 99d806b5e5eb335350f89cb438a5e31bc77f6d2d [file] [log] [blame]
Ilya Matyukhina9a3c852020-08-18 03:09:41 -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/fingerprint/BnSession.h>
20#include <aidl/android/hardware/biometrics/fingerprint/ISessionCallback.h>
21
22namespace aidl::android::hardware::biometrics::fingerprint {
23
Kevin Chyne33abd62020-09-18 10:31:50 -070024namespace common = aidl::android::hardware::biometrics::common;
25namespace keymaster = aidl::android::hardware::keymaster;
Ilya Matyukhina9a3c852020-08-18 03:09:41 -070026
27class Session : public BnSession {
28 public:
29 explicit Session(std::shared_ptr<ISessionCallback> cb);
30
Ilya Matyukhin3d54f452020-10-15 17:32:09 -070031 ndk::ScopedAStatus generateChallenge(int32_t cookie, int32_t timeoutSec) override;
32
33 ndk::ScopedAStatus revokeChallenge(int32_t cookie, int64_t challenge) override;
34
Ilya Matyukhina9a3c852020-08-18 03:09:41 -070035 ndk::ScopedAStatus enroll(int32_t cookie, const keymaster::HardwareAuthToken& hat,
Ilya Matyukhin124e70a2021-02-12 13:00:15 -080036 std::shared_ptr<common::ICancellationSignal>* out) override;
Ilya Matyukhina9a3c852020-08-18 03:09:41 -070037
Ilya Matyukhin124e70a2021-02-12 13:00:15 -080038 ndk::ScopedAStatus authenticate(int32_t cookie, int64_t keystoreOperationId,
39 std::shared_ptr<common::ICancellationSignal>* out) override;
Ilya Matyukhina9a3c852020-08-18 03:09:41 -070040
Ilya Matyukhin3d54f452020-10-15 17:32:09 -070041 ndk::ScopedAStatus detectInteraction(
Ilya Matyukhin124e70a2021-02-12 13:00:15 -080042 int32_t cookie, std::shared_ptr<common::ICancellationSignal>* out) override;
Ilya Matyukhina9a3c852020-08-18 03:09:41 -070043
44 ndk::ScopedAStatus enumerateEnrollments(int32_t cookie) override;
45
46 ndk::ScopedAStatus removeEnrollments(int32_t cookie,
47 const std::vector<int32_t>& enrollmentIds) override;
48
49 ndk::ScopedAStatus getAuthenticatorId(int32_t cookie) override;
50
Kevin Chyn4d0df262020-11-16 12:39:44 -080051 ndk::ScopedAStatus invalidateAuthenticatorId(int32_t cookie) override;
Kevin Chyn6e862c32020-09-16 18:27:37 -070052
Ilya Matyukhina9a3c852020-08-18 03:09:41 -070053 ndk::ScopedAStatus resetLockout(int32_t cookie,
54 const keymaster::HardwareAuthToken& hat) override;
55
Ilya Matyukhin71005c52021-02-17 12:44:14 -080056 ndk::ScopedAStatus close(int32_t cookie) override;
57
Ilya Matyukhina9a3c852020-08-18 03:09:41 -070058 ndk::ScopedAStatus onPointerDown(int32_t pointerId, int32_t x, int32_t y, float minor,
59 float major) override;
60
61 ndk::ScopedAStatus onPointerUp(int32_t pointerId) override;
62
63 ndk::ScopedAStatus onUiReady() override;
64
65 private:
Ilya Matyukhin124e70a2021-02-12 13:00:15 -080066 std::shared_ptr<ISessionCallback> mCb;
Ilya Matyukhina9a3c852020-08-18 03:09:41 -070067};
68
69} // namespace aidl::android::hardware::biometrics::fingerprint