Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c306b76f authored by Kevin Chyn's avatar Kevin Chyn
Browse files

Add HardwareInfo to CommonProps

Bug: 168541000
Test: make -j android.hardware.biometrics.common-update-api
Test: make -j
Change-Id: I2a96a46dc768b4cdb500ca8ea6bfd23c9f724866
parent 94a82210
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -21,4 +21,5 @@ parcelable CommonProps {
  int sensorId;
  android.hardware.biometrics.common.SensorStrength sensorStrength;
  int maxEnrollmentsPerUser;
  android.hardware.biometrics.common.HardwareInfo[] hardwareInfo;
}
+25 −0
Original line number Diff line number Diff line
///////////////////////////////////////////////////////////////////////////////
// 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;
}
+7 −0
Original line number Diff line number Diff line
@@ -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;
}
 No newline at end of file
+40 −0
Original line number Diff line number Diff line
/*
 * 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;
}
 No newline at end of file
+14 −1
Original line number Diff line number Diff line
@@ -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 */,