blob: 0ca45f85f030d8606c81e420ac4ae61c7d708228 [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#include "Fingerprint.h"
18#include "Session.h"
19
20namespace aidl::android::hardware::biometrics::fingerprint {
21
Kevin Chyn7d3fdf52020-09-15 13:01:40 -070022const int kSensorId = 0;
23const common::SensorStrength kSensorStrength = common::SensorStrength::STRONG;
24const int kMaxEnrollmentsPerUser = 5;
25const FingerprintSensorType kSensorType = FingerprintSensorType::REAR;
Kevin Chync306b762020-09-17 12:40:09 -070026const std::string kHwDeviceName = "fingerprintSensor";
27const std::string kHardwareVersion = "vendor/model/revision";
28const std::string kFirmwareVersion = "1.01";
29const std::string kSerialNumber = "00000001";
Kevin Chyn7d3fdf52020-09-15 13:01:40 -070030
31ndk::ScopedAStatus Fingerprint::getSensorProps(std::vector<SensorProps>* return_val) {
32 *return_val = std::vector<SensorProps>();
Kevin Chync306b762020-09-17 12:40:09 -070033
34 std::vector<common::HardwareInfo> hardwareInfos = std::vector<common::HardwareInfo>();
35 common::HardwareInfo sensorInfo = {kHwDeviceName,
36 kHardwareVersion,
37 kFirmwareVersion,
38 kSerialNumber
39 };
40 hardwareInfos.push_back(sensorInfo);
Kevin Chyn7d3fdf52020-09-15 13:01:40 -070041 common::CommonProps commonProps = {kSensorId,
42 kSensorStrength,
Kevin Chync306b762020-09-17 12:40:09 -070043 kMaxEnrollmentsPerUser,
44 hardwareInfos};
Kevin Chyn7d3fdf52020-09-15 13:01:40 -070045 SensorProps props = {commonProps,
Kevin Chyn94a82212020-09-16 18:55:39 -070046 kSensorType,
47 0 /* sensorLocationX */,
48 0 /* sensorLocationY */,
49 0 /* sensorRadius */,
50 0 /* displayId */};
Kevin Chyn7d3fdf52020-09-15 13:01:40 -070051 return_val->push_back(props);
Ilya Matyukhina9a3c852020-08-18 03:09:41 -070052 return ndk::ScopedAStatus::ok();
53}
54
55ndk::ScopedAStatus Fingerprint::createSession(int32_t /*sensorId*/, int32_t /*userId*/,
56 const std::shared_ptr<ISessionCallback>& cb,
57 std::shared_ptr<ISession>* return_val) {
58 *return_val = SharedRefBase::make<Session>(cb);
59 return ndk::ScopedAStatus::ok();
60}
61
62ndk::ScopedAStatus Fingerprint::setResetLockoutCallback(
63 const std::shared_ptr<IResetLockoutCallback>& /*cb*/) {
64 return ndk::ScopedAStatus::ok();
65}
66
67ndk::ScopedAStatus Fingerprint::generateChallenge(
Kevin Chyn6e862c32020-09-16 18:27:37 -070068 int32_t /*sensorId*/, int32_t /*userId*/, int32_t /*timeoutSec*/,
69 const std::shared_ptr<IGenerateChallengeCallback>& /*cb*/) {
Ilya Matyukhina9a3c852020-08-18 03:09:41 -070070 return ndk::ScopedAStatus::ok();
71}
72
73ndk::ScopedAStatus Fingerprint::revokeChallenge(
74 int32_t /*sensorId*/, int32_t /*userId*/,
75 const std::shared_ptr<IRevokeChallengeCallback>& /*cb*/) {
76 return ndk::ScopedAStatus::ok();
77}
78
79} // namespace aidl::android::hardware::biometrics::fingerprint