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

Commit 656b4f29 authored by Kevin Chyn's avatar Kevin Chyn
Browse files

Update fingerprint SensorLocation interface for multi-display

Allows the implementation to specify location relative to multiple
displays (instead of just one), from which the sensor is accessible
from.

Fixes: 174868353
Test: make -j android.hardware.biometrics.fingerprint-update-api
Test: make -j android.hardware.biometrics.fingerprint-service.example

Change-Id: I0d1c1d2bdc0ea817656c14b3b79381db994fdd75
parent 47b33fcb
Loading
Loading
Loading
Loading
+40 −0
Original line number Diff line number Diff line
/*
 * Copyright (C) 2021 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.
 *////////////////////////////////////////////////////////////////////////////////
// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE.                          //
///////////////////////////////////////////////////////////////////////////////

// This file is a snapshot of an AIDL file. Do not edit it manually. There are
// two cases:
// 1). this is a frozen version file - do not edit this in any case.
// 2). this is a 'current' file. If you make a backwards compatible change to
//     the interface (from the latest frozen version), the build system will
//     prompt you to update this file with `m <name>-update-api`.
//
// You must not make a backward incompatible change to any AIDL file 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.fingerprint;
@VintfStability
parcelable SensorLocation {
  int displayId;
  int sensorLocationX;
  int sensorLocationY;
  int sensorRadius;
}
+1 −4
Original line number Diff line number Diff line
@@ -35,10 +35,7 @@ package android.hardware.biometrics.fingerprint;
parcelable SensorProps {
  android.hardware.biometrics.common.CommonProps commonProps;
  android.hardware.biometrics.fingerprint.FingerprintSensorType sensorType;
  android.hardware.biometrics.fingerprint.SensorLocation[] sensorLocations;
  boolean supportsNavigationGestures;
  int sensorLocationX;
  int sensorLocationY;
  int sensorRadius;
  int displayId;
  boolean supportsDetectInteraction;
}
+54 −0
Original line number Diff line number Diff line
/*
 * Copyright (C) 2021 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.fingerprint;

@VintfStability
parcelable SensorLocation {
    /**
     * The display to which the following measurements are relative to. This must correspond to the
     * android.hardware.DisplayManager#getDisplay Android API.
     *
     * A few examples:
     *   1) A capacitive rear fingerprint sensor would specify the display to which it is behind.
     *   2) An under-display fingerprint sensor would specify the display on which the sensor is
     *      located.
     *   3) A foldable device would specify multiple locations and have a SensorLocation entry
     *      for each display from which the sensor is accessible from.
     */
    int displayId;

    /**
     * The location of the center of the sensor if applicable. For example, sensors of
     * FingerprintSensorType::UNDER_DISPLAY_* would report this value as the distance in pixels,
     * measured from the left edge of the screen.
     */
    int sensorLocationX;

    /**
     * The location of the center of the sensor if applicable. For example, sensors of
     * FingerprintSensorType::UNDER_DISPLAY_* would report this value as the distance in pixels,
     * measured from the top edge of the screen.
     */
    int sensorLocationY;

    /**
     * The radius of the sensor if applicable. For example, sensors of
     * FingerprintSensorType::UNDER_DISPLAY_* would report this value as the radius of the sensor,
     * in pixels.
     */
    int sensorRadius;
}
 No newline at end of file
+7 −27
Original line number Diff line number Diff line
@@ -18,6 +18,7 @@ package android.hardware.biometrics.fingerprint;

import android.hardware.biometrics.common.CommonProps;
import android.hardware.biometrics.fingerprint.FingerprintSensorType;
import android.hardware.biometrics.fingerprint.SensorLocation;

@VintfStability
parcelable SensorProps {
@@ -32,37 +33,16 @@ parcelable SensorProps {
    FingerprintSensorType sensorType;

    /**
     * Must be set to true for sensors that support "swipe" gestures via
     * android.view.KeyEvent#KEYCODE_SYSTEM_NAVIGATION_*.
     */
    boolean supportsNavigationGestures;

    /**
     * The location of the center of the sensor if applicable. For example, sensors of
     * FingerprintSensorType::UNDER_DISPLAY_* would report this value as the distance in pixels,
     * measured from the left edge of the screen.
     * A list of display-specific locations from where the sensor is usable from. See SensorLocation
     * for more details.
     */
    int sensorLocationX;
    SensorLocation[] sensorLocations;

    /**
     * The location of the center of the sensor if applicable. For example, sensors of
     * FingerprintSensorType::UNDER_DISPLAY_* would report this value as the distance in pixels,
     * measured from the top edge of the screen.
     */
    int sensorLocationY;

    /**
     * The radius of the sensor if applicable. For example, sensors of
     * FingerprintSensorType::UNDER_DISPLAY_* would report this value as the radius of the sensor,
     * in pixels.
     */
    int sensorRadius;

    /**
     * For sensors of FingerprintSensorType::UNDER_DISPLAY_*, this must correspond to the
     * android.hardware.DisplayManager#getDisplay Android API.
     * Must be set to true for sensors that support "swipe" gestures via
     * android.view.KeyEvent#KEYCODE_SYSTEM_NAVIGATION_*.
     */
    int displayId;
    boolean supportsNavigationGestures;

    /**
     * Specifies whether or not the implementation supports ISession#detectInteraction.
+8 −4
Original line number Diff line number Diff line
@@ -43,13 +43,17 @@ ndk::ScopedAStatus Fingerprint::getSensorProps(std::vector<SensorProps>* return_
            kSensorStrength,
            kMaxEnrollmentsPerUser,
            hardwareInfos};
    SensorLocation sensorLocation = {
            0 /* displayId */,
            0 /* sensorLocationX */,
            0 /* sensorLocationY */,
            0 /* sensorRadius */
    };
    SensorProps props = {commonProps,
            kSensorType,
            {sensorLocation},
            kSupportsNavigationGestures,
            0 /* sensorLocationX */,
            0 /* sensorLocationY */,
            0 /* sensorRadius */,
            0 /* displayId */};
            false /* supportsDetectInteraction */};
    return_val->push_back(props);
    return ndk::ScopedAStatus::ok();
}