mirror of
https://github.com/Evolution-X/hardware_interfaces
synced 2026-02-01 11:36:00 +00:00
Add HardwareInfo to CommonProps
Bug: 168541000 Test: make -j android.hardware.biometrics.common-update-api Test: make -j Change-Id: I2a96a46dc768b4cdb500ca8ea6bfd23c9f724866
This commit is contained in:
@@ -21,4 +21,5 @@ parcelable CommonProps {
|
||||
int sensorId;
|
||||
android.hardware.biometrics.common.SensorStrength sensorStrength;
|
||||
int maxEnrollmentsPerUser;
|
||||
android.hardware.biometrics.common.HardwareInfo[] hardwareInfo;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
// This file is a snapshot of an AIDL interface (or parcelable). Do not try to
|
||||
// edit this file. It looks like you are doing that because you have modified
|
||||
// an AIDL interface in a backward-incompatible way, e.g., deleting a function
|
||||
// from an interface or a field from a parcelable and it broke the build. That
|
||||
// breakage is intended.
|
||||
//
|
||||
// You must not make a backward incompatible changes to the AIDL files built
|
||||
// with the aidl_interface module type with versions property set. The module
|
||||
// type is used to build AIDL files in a way that they can be used across
|
||||
// independently updatable components of the system. If a device is shipped
|
||||
// with such a backward incompatible change, it has a high risk of breaking
|
||||
// later when a module using the interface is updated, e.g., Mainline modules.
|
||||
|
||||
package android.hardware.biometrics.common;
|
||||
@VintfStability
|
||||
parcelable HardwareInfo {
|
||||
String deviceName;
|
||||
String hardwareVersion;
|
||||
String firmwareVersion;
|
||||
String serialNumber;
|
||||
}
|
||||
@@ -16,6 +16,7 @@
|
||||
|
||||
package android.hardware.biometrics.common;
|
||||
|
||||
import android.hardware.biometrics.common.HardwareInfo;
|
||||
import android.hardware.biometrics.common.SensorStrength;
|
||||
|
||||
@VintfStability
|
||||
@@ -40,4 +41,10 @@ parcelable CommonProps {
|
||||
* Statically configured.
|
||||
*/
|
||||
int maxEnrollmentsPerUser;
|
||||
|
||||
/**
|
||||
* A list of hardware information for subsystems that pertain to this
|
||||
* biometric sensor.
|
||||
*/
|
||||
HardwareInfo[] hardwareInfo;
|
||||
}
|
||||
@@ -0,0 +1,40 @@
|
||||
/*
|
||||
* Copyright (C) 2020 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package android.hardware.biometrics.common;
|
||||
|
||||
@VintfStability
|
||||
parcelable HardwareInfo {
|
||||
/**
|
||||
* An identifier uniquely identifying a subsystem.
|
||||
*/
|
||||
String deviceName;
|
||||
|
||||
/**
|
||||
* The hardware version. For example, <vendor>/<model>/<revision>.
|
||||
*/
|
||||
String hardwareVersion;
|
||||
|
||||
/**
|
||||
* The firmware version.
|
||||
*/
|
||||
String firmwareVersion;
|
||||
|
||||
/**
|
||||
* The sensor's serial number.
|
||||
*/
|
||||
String serialNumber;
|
||||
}
|
||||
@@ -23,12 +23,25 @@ const int kSensorId = 0;
|
||||
const common::SensorStrength kSensorStrength = common::SensorStrength::STRONG;
|
||||
const int kMaxEnrollmentsPerUser = 5;
|
||||
const FingerprintSensorType kSensorType = FingerprintSensorType::REAR;
|
||||
const std::string kHwDeviceName = "fingerprintSensor";
|
||||
const std::string kHardwareVersion = "vendor/model/revision";
|
||||
const std::string kFirmwareVersion = "1.01";
|
||||
const std::string kSerialNumber = "00000001";
|
||||
|
||||
ndk::ScopedAStatus Fingerprint::getSensorProps(std::vector<SensorProps>* return_val) {
|
||||
*return_val = std::vector<SensorProps>();
|
||||
|
||||
std::vector<common::HardwareInfo> hardwareInfos = std::vector<common::HardwareInfo>();
|
||||
common::HardwareInfo sensorInfo = {kHwDeviceName,
|
||||
kHardwareVersion,
|
||||
kFirmwareVersion,
|
||||
kSerialNumber
|
||||
};
|
||||
hardwareInfos.push_back(sensorInfo);
|
||||
common::CommonProps commonProps = {kSensorId,
|
||||
kSensorStrength,
|
||||
kMaxEnrollmentsPerUser};
|
||||
kMaxEnrollmentsPerUser,
|
||||
hardwareInfos};
|
||||
SensorProps props = {commonProps,
|
||||
kSensorType,
|
||||
0 /* sensorLocationX */,
|
||||
|
||||
Reference in New Issue
Block a user