blob: a4520deb470f9c55f0b2d4b531f88f6e53521d30 [file] [log] [blame]
Ilya Matyukhin09166982020-10-12 13:41:03 -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 "Face.h"
18#include "Session.h"
19
20namespace aidl::android::hardware::biometrics::face {
21
Kevin Chyn4e7c0162020-12-11 15:45:54 -080022const int kSensorId = 4;
Kevin Chyncfb54992020-11-17 13:06:23 -080023const common::SensorStrength kSensorStrength = common::SensorStrength::STRONG;
Ilya Matyukhin09166982020-10-12 13:41:03 -070024const int kMaxEnrollmentsPerUser = 5;
25const FaceSensorType kSensorType = FaceSensorType::RGB;
26const bool kHalControlsPreview = true;
27const std::string kHwDeviceName = "faceSensor";
28const std::string kHardwareVersion = "vendor/model/revision";
Ilya Matyukhin09166982020-10-12 13:41:03 -070029const std::string kSerialNumber = "00000001";
Haining Chen5feda3d2021-02-23 13:58:58 -080030const std::string kSoftwareVersion = "vendor1/algorithm1/version;vendor2/algorithm2/version";
Ilya Matyukhin09166982020-10-12 13:41:03 -070031
32ndk::ScopedAStatus Face::getSensorProps(std::vector<SensorProps>* return_val) {
33 common::HardwareInfo hardware_info;
34 hardware_info.deviceName = kHwDeviceName;
35 hardware_info.hardwareVersion = kHardwareVersion;
Ilya Matyukhin09166982020-10-12 13:41:03 -070036 hardware_info.serialNumber = kSerialNumber;
37
38 common::CommonProps commonProps;
39 commonProps.sensorId = kSensorId;
40 commonProps.sensorStrength = kSensorStrength;
41 commonProps.maxEnrollmentsPerUser = kMaxEnrollmentsPerUser;
42 commonProps.hardwareInfo = {std::move(hardware_info)};
Haining Chen5feda3d2021-02-23 13:58:58 -080043 commonProps.softwareInfo = kSoftwareVersion;
Ilya Matyukhin09166982020-10-12 13:41:03 -070044
45 SensorProps props;
46 props.commonProps = std::move(commonProps);
47 props.sensorType = kSensorType;
48 props.halControlsPreview = kHalControlsPreview;
Kevin Chynbad76852020-11-11 13:23:35 -080049 props.enrollPreviewWidth = 1080;
50 props.enrollPreviewHeight = 1920;
51 props.enrollTranslationX = 100.f;
52 props.enrollTranslationY = 50.f;
53 props.enrollPreviewScale = 1.f;
Ilya Matyukhin09166982020-10-12 13:41:03 -070054
55 *return_val = {std::move(props)};
56 return ndk::ScopedAStatus::ok();
57}
58
59ndk::ScopedAStatus Face::createSession(int32_t /*sensorId*/, int32_t /*userId*/,
60 const std::shared_ptr<ISessionCallback>& cb,
61 std::shared_ptr<ISession>* return_val) {
62 *return_val = SharedRefBase::make<Session>(cb);
63 return ndk::ScopedAStatus::ok();
64}
65
Ilya Matyukhin09166982020-10-12 13:41:03 -070066} // namespace aidl::android::hardware::biometrics::face