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 | |
Kevin Chyn | e33abd6 | 2020-09-18 10:31:50 -0700 | [diff] [blame^] | 17 | #include <aidl/android/hardware/biometrics/common/BnCancellationSignal.h> |
Ilya Matyukhin | a9a3c85 | 2020-08-18 03:09:41 -0700 | [diff] [blame] | 18 | |
| 19 | #include "Session.h" |
| 20 | |
| 21 | namespace aidl::android::hardware::biometrics::fingerprint { |
| 22 | |
Kevin Chyn | e33abd6 | 2020-09-18 10:31:50 -0700 | [diff] [blame^] | 23 | class CancellationSignal : public common::BnCancellationSignal { |
Ilya Matyukhin | a9a3c85 | 2020-08-18 03:09:41 -0700 | [diff] [blame] | 24 | public: |
| 25 | ndk::ScopedAStatus cancel() override { return ndk::ScopedAStatus::ok(); } |
| 26 | }; |
| 27 | |
| 28 | Session::Session(std::shared_ptr<ISessionCallback> cb) : cb_(std::move(cb)) {} |
| 29 | |
| 30 | ndk::ScopedAStatus Session::enroll(int32_t /*cookie*/, const keymaster::HardwareAuthToken& /*hat*/, |
Kevin Chyn | e33abd6 | 2020-09-18 10:31:50 -0700 | [diff] [blame^] | 31 | std::shared_ptr<common::ICancellationSignal>* /*return_val*/) { |
Ilya Matyukhin | a9a3c85 | 2020-08-18 03:09:41 -0700 | [diff] [blame] | 32 | return ndk::ScopedAStatus::ok(); |
| 33 | } |
| 34 | |
| 35 | ndk::ScopedAStatus Session::authenticate(int32_t /*cookie*/, int64_t /*keystoreOperationId*/, |
Kevin Chyn | e33abd6 | 2020-09-18 10:31:50 -0700 | [diff] [blame^] | 36 | std::shared_ptr<common::ICancellationSignal>* return_val) { |
Ilya Matyukhin | a9a3c85 | 2020-08-18 03:09:41 -0700 | [diff] [blame] | 37 | if (cb_) { |
| 38 | cb_->onStateChanged(0, SessionState::AUTHENTICATING); |
| 39 | } |
| 40 | *return_val = SharedRefBase::make<CancellationSignal>(); |
| 41 | return ndk::ScopedAStatus::ok(); |
| 42 | } |
| 43 | |
| 44 | ndk::ScopedAStatus Session::detectInteraction( |
Kevin Chyn | e33abd6 | 2020-09-18 10:31:50 -0700 | [diff] [blame^] | 45 | int32_t /*cookie*/, std::shared_ptr<common::ICancellationSignal>* /*return_val*/) { |
Ilya Matyukhin | a9a3c85 | 2020-08-18 03:09:41 -0700 | [diff] [blame] | 46 | return ndk::ScopedAStatus::ok(); |
| 47 | } |
| 48 | |
| 49 | ndk::ScopedAStatus Session::enumerateEnrollments(int32_t /*cookie*/) { |
| 50 | return ndk::ScopedAStatus::ok(); |
| 51 | } |
| 52 | |
| 53 | ndk::ScopedAStatus Session::removeEnrollments(int32_t /*cookie*/, |
| 54 | const std::vector<int32_t>& /*enrollmentIds*/) { |
| 55 | return ndk::ScopedAStatus::ok(); |
| 56 | } |
| 57 | |
| 58 | ndk::ScopedAStatus Session::getAuthenticatorId(int32_t /*cookie*/) { |
| 59 | return ndk::ScopedAStatus::ok(); |
| 60 | } |
| 61 | |
Kevin Chyn | 6e862c3 | 2020-09-16 18:27:37 -0700 | [diff] [blame] | 62 | ndk::ScopedAStatus Session::invalidateAuthenticatorId(int32_t /*cookie*/, |
| 63 | const keymaster::HardwareAuthToken& /*hat*/) { |
| 64 | return ndk::ScopedAStatus::ok(); |
| 65 | } |
| 66 | |
Ilya Matyukhin | a9a3c85 | 2020-08-18 03:09:41 -0700 | [diff] [blame] | 67 | ndk::ScopedAStatus Session::resetLockout(int32_t /*cookie*/, |
| 68 | const keymaster::HardwareAuthToken& /*hat*/) { |
| 69 | return ndk::ScopedAStatus::ok(); |
| 70 | } |
| 71 | |
| 72 | ndk::ScopedAStatus Session::onPointerDown(int32_t /*pointerId*/, int32_t /*x*/, int32_t /*y*/, |
| 73 | float /*minor*/, float /*major*/) { |
| 74 | return ndk::ScopedAStatus::ok(); |
| 75 | } |
| 76 | |
| 77 | ndk::ScopedAStatus Session::onPointerUp(int32_t /*pointerId*/) { |
| 78 | return ndk::ScopedAStatus::ok(); |
| 79 | } |
| 80 | |
| 81 | ndk::ScopedAStatus Session::onUiReady() { |
| 82 | return ndk::ScopedAStatus::ok(); |
| 83 | } |
| 84 | |
| 85 | } // namespace aidl::android::hardware::biometrics::fingerprint |