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

Commit bbddf477 authored by Ilya Matyukhin's avatar Ilya Matyukhin Committed by Android (Google) Code Review
Browse files

Merge changes I165d67bd,I4442db15 into sc-dev

* changes:
  Notify AuthController when fingerprint providers are ready
  Consolidate registration of HIDL and AIDL HALs
parents 909042e9 06f04c04
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -44,7 +44,7 @@ public class SensorPropertiesInternal implements Parcelable {
                prop.resetLockoutRequiresHardwareAuthToken, prop.resetLockoutRequiresChallenge);
    }

    protected SensorPropertiesInternal(int sensorId, @SensorProperties.Strength int sensorStrength,
    public SensorPropertiesInternal(int sensorId, @SensorProperties.Strength int sensorStrength,
            int maxEnrollmentsPerUser, @NonNull List<ComponentInfoInternal> componentInfo,
            boolean resetLockoutRequiresHardwareAuthToken, boolean resetLockoutRequiresChallenge) {
        this.sensorId = sensorId;
+4 −2
Original line number Diff line number Diff line
@@ -127,6 +127,8 @@ interface IFaceService {
    void getFeature(IBinder token, int userId, int feature, IFaceServiceReceiver receiver,
            String opPackageName);

    // Give FaceService its ID. See AuthService.java
    void initializeConfiguration(int sensorId, int strength);
    // Registers all HIDL and AIDL sensors. Only HIDL sensor properties need to be provided, because
    // AIDL sensor properties are retrieved directly from the available HALs. If no HIDL HALs exist,
    // hidlSensors must be non-null and empty. See AuthService.java
    void registerAuthenticators(in List<FaceSensorPropertiesInternal> hidlSensors);
}
+25 −0
Original line number Diff line number Diff line
@@ -1012,6 +1012,31 @@ public class FingerprintManager implements BiometricAuthenticator, BiometricFing
        return sensorProps.sensorType == TYPE_POWER_BUTTON;
    }

    /**
     * Adds a callback that gets called when the service registers all of the fingerprint
     * authenticators (HALs).
     *
     * If the fingerprint authenticators are already registered when the callback is added, the
     * callback is invoked immediately.
     *
     * The callback is automatically removed after it's invoked.
     *
     * @hide
     */
    @RequiresPermission(USE_BIOMETRIC_INTERNAL)
    public void addAuthenticatorsRegisteredCallback(
            IFingerprintAuthenticatorsRegisteredCallback callback) {
        if (mService != null) {
            try {
                mService.addAuthenticatorsRegisteredCallback(callback);
            } catch (RemoteException e) {
                throw e.rethrowFromSystemServer();
            }
        } else {
            Slog.w(TAG, "addProvidersAvailableCallback(): Service not connected!");
        }
    }

    /**
     * @hide
     */
+0 −29
Original line number Diff line number Diff line
@@ -20,7 +20,6 @@ import static android.hardware.fingerprint.FingerprintSensorProperties.TYPE_UDFP
import static android.hardware.fingerprint.FingerprintSensorProperties.TYPE_UDFPS_ULTRASONIC;

import android.annotation.NonNull;
import android.content.Context;
import android.hardware.biometrics.ComponentInfoInternal;
import android.hardware.biometrics.SensorProperties;
import android.hardware.biometrics.SensorPropertiesInternal;
@@ -92,34 +91,6 @@ public class FingerprintSensorPropertiesInternal extends SensorPropertiesInterna
                1636 /* sensorLocationY */, 130 /* sensorRadius */);
    }

    /**
     * Initializes SensorProperties with specified values and values obtained from resources using
     * context.
     */
    // TODO(b/179175438): Remove this constructor once all HALs move to AIDL.
    public FingerprintSensorPropertiesInternal(@NonNull Context context, int sensorId,
            @SensorProperties.Strength int strength, int maxEnrollmentsPerUser,
            @NonNull List<ComponentInfoInternal> componentInfo,
            @FingerprintSensorProperties.SensorType int sensorType,
            boolean resetLockoutRequiresHardwareAuthToken) {
        super(sensorId, strength, maxEnrollmentsPerUser, componentInfo,
            resetLockoutRequiresHardwareAuthToken, false /* resetLockoutRequiresChallenge */);
        this.sensorType = sensorType;

        int[] props = context.getResources().getIntArray(
                com.android.internal.R.array.config_udfps_sensor_props);
        if (props != null && props.length == 3) {
            this.sensorLocationX = props[0];
            this.sensorLocationY = props[1];
            this.sensorRadius = props[2];
        } else {
            // Fake coordinates that could be used for the fake UDFPS mode.
            this.sensorLocationX = 540;
            this.sensorLocationY = 1636;
            this.sensorRadius = 130;
        }
    }

    protected FingerprintSensorPropertiesInternal(Parcel in) {
        super(in);
        sensorType = in.readInt();
+35 −0
Original line number Diff line number Diff line
/*
 * Copyright (C) 2020 The Android Open Source Project
 * 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.
@@ -13,16 +13,23 @@
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package android.hardware.fingerprint;

package com.android.server.biometrics.sensors;
import android.hardware.fingerprint.FingerprintSensorPropertiesInternal;
import java.util.List;

/**
 * System_server services that require BiometricService to load before finishing initialization
 * should implement this interface.
 * Callback to notify FingerprintManager that FingerprintService has registered all of the
 * fingerprint authenticators (HALs).
 * See {@link android.hardware.fingerprint.IFingerprintService#registerAuthenticators}.
 *
 * @hide
 */
public interface BiometricServiceCallback {
oneway interface IFingerprintAuthenticatorsRegisteredCallback {
    /**
     * Notifies the service that BiometricService is initialized.
     * Notifies FingerprintManager that all of the fingerprint authenticators have been registered.
     *
     * @param sensors A consolidated list of sensor properties for all of the authenticators.
     */
    void onBiometricServiceReady();
    void onAllAuthenticatorsRegistered(in List<FingerprintSensorPropertiesInternal> sensors);
}
Loading