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 | #include "Fingerprint.h" |
| 18 | #include "Session.h" |
| 19 | |
| 20 | namespace aidl::android::hardware::biometrics::fingerprint { |
| 21 | |
Kevin Chyn | 7d3fdf5 | 2020-09-15 13:01:40 -0700 | [diff] [blame] | 22 | const int kSensorId = 0; |
| 23 | const common::SensorStrength kSensorStrength = common::SensorStrength::STRONG; |
| 24 | const int kMaxEnrollmentsPerUser = 5; |
| 25 | const FingerprintSensorType kSensorType = FingerprintSensorType::REAR; |
| 26 | |
| 27 | ndk::ScopedAStatus Fingerprint::getSensorProps(std::vector<SensorProps>* return_val) { |
| 28 | *return_val = std::vector<SensorProps>(); |
| 29 | common::CommonProps commonProps = {kSensorId, |
| 30 | kSensorStrength, |
| 31 | kMaxEnrollmentsPerUser}; |
| 32 | SensorProps props = {commonProps, |
Kevin Chyn | 94a8221 | 2020-09-16 18:55:39 -0700 | [diff] [blame^] | 33 | kSensorType, |
| 34 | 0 /* sensorLocationX */, |
| 35 | 0 /* sensorLocationY */, |
| 36 | 0 /* sensorRadius */, |
| 37 | 0 /* displayId */}; |
Kevin Chyn | 7d3fdf5 | 2020-09-15 13:01:40 -0700 | [diff] [blame] | 38 | return_val->push_back(props); |
Ilya Matyukhin | a9a3c85 | 2020-08-18 03:09:41 -0700 | [diff] [blame] | 39 | return ndk::ScopedAStatus::ok(); |
| 40 | } |
| 41 | |
| 42 | ndk::ScopedAStatus Fingerprint::createSession(int32_t /*sensorId*/, int32_t /*userId*/, |
| 43 | const std::shared_ptr<ISessionCallback>& cb, |
| 44 | std::shared_ptr<ISession>* return_val) { |
| 45 | *return_val = SharedRefBase::make<Session>(cb); |
| 46 | return ndk::ScopedAStatus::ok(); |
| 47 | } |
| 48 | |
| 49 | ndk::ScopedAStatus Fingerprint::setResetLockoutCallback( |
| 50 | const std::shared_ptr<IResetLockoutCallback>& /*cb*/) { |
| 51 | return ndk::ScopedAStatus::ok(); |
| 52 | } |
| 53 | |
| 54 | ndk::ScopedAStatus Fingerprint::generateChallenge( |
Kevin Chyn | 6e862c3 | 2020-09-16 18:27:37 -0700 | [diff] [blame] | 55 | int32_t /*sensorId*/, int32_t /*userId*/, int32_t /*timeoutSec*/, |
| 56 | const std::shared_ptr<IGenerateChallengeCallback>& /*cb*/) { |
Ilya Matyukhin | a9a3c85 | 2020-08-18 03:09:41 -0700 | [diff] [blame] | 57 | return ndk::ScopedAStatus::ok(); |
| 58 | } |
| 59 | |
| 60 | ndk::ScopedAStatus Fingerprint::revokeChallenge( |
| 61 | int32_t /*sensorId*/, int32_t /*userId*/, |
| 62 | const std::shared_ptr<IRevokeChallengeCallback>& /*cb*/) { |
| 63 | return ndk::ScopedAStatus::ok(); |
| 64 | } |
| 65 | |
| 66 | } // namespace aidl::android::hardware::biometrics::fingerprint |