Ilya Matyukhin | a9a3c85 | 2020-08-18 03:09:41 -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/fingerprint/BnSession.h> |
| 20 | #include <aidl/android/hardware/biometrics/fingerprint/ISessionCallback.h> |
| 21 | |
| 22 | namespace aidl::android::hardware::biometrics::fingerprint { |
| 23 | |
Kevin Chyn | e33abd6 | 2020-09-18 10:31:50 -0700 | [diff] [blame] | 24 | namespace common = aidl::android::hardware::biometrics::common; |
| 25 | namespace keymaster = aidl::android::hardware::keymaster; |
Ilya Matyukhin | a9a3c85 | 2020-08-18 03:09:41 -0700 | [diff] [blame] | 26 | |
| 27 | class Session : public BnSession { |
| 28 | public: |
| 29 | explicit Session(std::shared_ptr<ISessionCallback> cb); |
| 30 | |
| 31 | ndk::ScopedAStatus enroll(int32_t cookie, const keymaster::HardwareAuthToken& hat, |
Kevin Chyn | e33abd6 | 2020-09-18 10:31:50 -0700 | [diff] [blame] | 32 | std::shared_ptr<common::ICancellationSignal>* return_val) override; |
Ilya Matyukhin | a9a3c85 | 2020-08-18 03:09:41 -0700 | [diff] [blame] | 33 | |
| 34 | ndk::ScopedAStatus authenticate(int32_t cookie, int64_t keystoreOperationId, |
Kevin Chyn | e33abd6 | 2020-09-18 10:31:50 -0700 | [diff] [blame] | 35 | std::shared_ptr<common::ICancellationSignal>* return_val) override; |
Ilya Matyukhin | a9a3c85 | 2020-08-18 03:09:41 -0700 | [diff] [blame] | 36 | |
| 37 | ndk::ScopedAStatus detectInteraction(int32_t cookie, |
Kevin Chyn | e33abd6 | 2020-09-18 10:31:50 -0700 | [diff] [blame] | 38 | std::shared_ptr<common::ICancellationSignal>* return_val) override; |
Ilya Matyukhin | a9a3c85 | 2020-08-18 03:09:41 -0700 | [diff] [blame] | 39 | |
| 40 | ndk::ScopedAStatus enumerateEnrollments(int32_t cookie) override; |
| 41 | |
| 42 | ndk::ScopedAStatus removeEnrollments(int32_t cookie, |
| 43 | const std::vector<int32_t>& enrollmentIds) override; |
| 44 | |
| 45 | ndk::ScopedAStatus getAuthenticatorId(int32_t cookie) override; |
| 46 | |
Kevin Chyn | 6e862c3 | 2020-09-16 18:27:37 -0700 | [diff] [blame] | 47 | ndk::ScopedAStatus invalidateAuthenticatorId(int32_t cookie, |
| 48 | const keymaster::HardwareAuthToken& hat) override; |
| 49 | |
Ilya Matyukhin | a9a3c85 | 2020-08-18 03:09:41 -0700 | [diff] [blame] | 50 | ndk::ScopedAStatus resetLockout(int32_t cookie, |
| 51 | const keymaster::HardwareAuthToken& hat) override; |
| 52 | |
| 53 | ndk::ScopedAStatus onPointerDown(int32_t pointerId, int32_t x, int32_t y, float minor, |
| 54 | float major) override; |
| 55 | |
| 56 | ndk::ScopedAStatus onPointerUp(int32_t pointerId) override; |
| 57 | |
| 58 | ndk::ScopedAStatus onUiReady() override; |
| 59 | |
| 60 | private: |
| 61 | std::shared_ptr<ISessionCallback> cb_; |
| 62 | }; |
| 63 | |
| 64 | } // namespace aidl::android::hardware::biometrics::fingerprint |