blob: f27e278574d67e0c741f6d31fd5faa0e77885894 [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 Chyn09fc7042020-11-17 19:06:53 -080022const int kSensorId = 1;
Kevin Chyn7d3fdf52020-09-15 13:01:40 -070023const common::SensorStrength kSensorStrength = common::SensorStrength::STRONG;
24const int kMaxEnrollmentsPerUser = 5;
25const FingerprintSensorType kSensorType = FingerprintSensorType::REAR;
Kevin Chyne33abd62020-09-18 10:31:50 -070026const bool kSupportsNavigationGestures = true;
Kevin Chync306b762020-09-17 12:40:09 -070027const std::string kHwDeviceName = "fingerprintSensor";
28const std::string kHardwareVersion = "vendor/model/revision";
29const std::string kFirmwareVersion = "1.01";
30const std::string kSerialNumber = "00000001";
Kevin Chyn7d3fdf52020-09-15 13:01:40 -070031
32ndk::ScopedAStatus Fingerprint::getSensorProps(std::vector<SensorProps>* return_val) {
33 *return_val = std::vector<SensorProps>();
Kevin Chync306b762020-09-17 12:40:09 -070034
35 std::vector<common::HardwareInfo> hardwareInfos = std::vector<common::HardwareInfo>();
36 common::HardwareInfo sensorInfo = {kHwDeviceName,
37 kHardwareVersion,
38 kFirmwareVersion,
39 kSerialNumber
40 };
41 hardwareInfos.push_back(sensorInfo);
Kevin Chyn7d3fdf52020-09-15 13:01:40 -070042 common::CommonProps commonProps = {kSensorId,
43 kSensorStrength,
Kevin Chync306b762020-09-17 12:40:09 -070044 kMaxEnrollmentsPerUser,
45 hardwareInfos};
Kevin Chyn656b4f22021-02-05 16:58:44 -080046 SensorLocation sensorLocation = {
47 0 /* displayId */,
Kevin Chyn94a82212020-09-16 18:55:39 -070048 0 /* sensorLocationX */,
49 0 /* sensorLocationY */,
Kevin Chyn656b4f22021-02-05 16:58:44 -080050 0 /* sensorRadius */
51 };
52 SensorProps props = {commonProps,
53 kSensorType,
54 {sensorLocation},
55 kSupportsNavigationGestures,
56 false /* supportsDetectInteraction */};
Kevin Chyn7d3fdf52020-09-15 13:01:40 -070057 return_val->push_back(props);
Ilya Matyukhina9a3c852020-08-18 03:09:41 -070058 return ndk::ScopedAStatus::ok();
59}
60
61ndk::ScopedAStatus Fingerprint::createSession(int32_t /*sensorId*/, int32_t /*userId*/,
62 const std::shared_ptr<ISessionCallback>& cb,
63 std::shared_ptr<ISession>* return_val) {
64 *return_val = SharedRefBase::make<Session>(cb);
65 return ndk::ScopedAStatus::ok();
66}
Ilya Matyukhina9a3c852020-08-18 03:09:41 -070067} // namespace aidl::android::hardware::biometrics::fingerprint