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

Commit 64fce110 authored by Joe Bolinger's avatar Joe Bolinger Committed by Android (Google) Code Review
Browse files

Merge "Revert "Copy startup & callback mechanism from fingerprint to face service.""

parents 5f8a3113 8f5bb9d3
Loading
Loading
Loading
Loading
+0 −40
Original line number Original line Diff line number Diff line
@@ -29,7 +29,6 @@ import android.content.Context;
import android.hardware.biometrics.BiometricAuthenticator;
import android.hardware.biometrics.BiometricAuthenticator;
import android.hardware.biometrics.BiometricConstants;
import android.hardware.biometrics.BiometricConstants;
import android.hardware.biometrics.BiometricFaceConstants;
import android.hardware.biometrics.BiometricFaceConstants;
import android.hardware.biometrics.BiometricStateListener;
import android.hardware.biometrics.CryptoObject;
import android.hardware.biometrics.CryptoObject;
import android.hardware.biometrics.IBiometricServiceLockoutResetCallback;
import android.hardware.biometrics.IBiometricServiceLockoutResetCallback;
import android.os.Binder;
import android.os.Binder;
@@ -674,45 +673,6 @@ public class FaceManager implements BiometricAuthenticator, BiometricFaceConstan
        return new ArrayList<>();
        return new ArrayList<>();
    }
    }


    /**
     * Forwards BiometricStateListener to FaceService.
     *
     * @param listener new BiometricStateListener being added
     * @hide
     */
    public void registerBiometricStateListener(@NonNull BiometricStateListener listener) {
        try {
            mService.registerBiometricStateListener(listener);
        } catch (RemoteException e) {
            throw e.rethrowFromSystemServer();
        }
    }

    /**
     * Adds a callback that gets called when the service registers all of the face
     * authenticators (HALs).
     *
     * If the face 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(
            IFaceAuthenticatorsRegisteredCallback callback) {
        if (mService != null) {
            try {
                mService.addAuthenticatorsRegisteredCallback(callback);
            } catch (RemoteException e) {
                throw e.rethrowFromSystemServer();
            }
        } else {
            Slog.w(TAG, "addAuthenticatorsRegisteredCallback(): Service not connected!");
        }
    }

    /**
    /**
     * @hide
     * @hide
     */
     */
+0 −35
Original line number Original line Diff line number Diff line
/*
 * Copyright (C) 2022 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.face;

import android.hardware.face.FaceSensorPropertiesInternal;
import java.util.List;

/**
 * Callback to notify FaceManager that FaceService has registered all of the
 * face authenticators (HALs).
 * See {@link android.hardware.face.IFaceService#registerAuthenticators}.
 *
 * @hide
 */
oneway interface IFaceAuthenticatorsRegisteredCallback {
    /**
     * Notifies FaceManager that all of the face authenticators have been registered.
     *
     * @param sensors A consolidated list of sensor properties for all of the authenticators.
     */
    void onAllAuthenticatorsRegistered(in List<FaceSensorPropertiesInternal> sensors);
}
+0 −9
Original line number Original line Diff line number Diff line
@@ -17,11 +17,9 @@ package android.hardware.face;


import android.hardware.biometrics.IBiometricSensorReceiver;
import android.hardware.biometrics.IBiometricSensorReceiver;
import android.hardware.biometrics.IBiometricServiceLockoutResetCallback;
import android.hardware.biometrics.IBiometricServiceLockoutResetCallback;
import android.hardware.biometrics.IBiometricStateListener;
import android.hardware.biometrics.IInvalidationCallback;
import android.hardware.biometrics.IInvalidationCallback;
import android.hardware.biometrics.ITestSession;
import android.hardware.biometrics.ITestSession;
import android.hardware.biometrics.ITestSessionCallback;
import android.hardware.biometrics.ITestSessionCallback;
import android.hardware.face.IFaceAuthenticatorsRegisteredCallback;
import android.hardware.face.IFaceServiceReceiver;
import android.hardware.face.IFaceServiceReceiver;
import android.hardware.face.Face;
import android.hardware.face.Face;
import android.hardware.face.FaceSensorPropertiesInternal;
import android.hardware.face.FaceSensorPropertiesInternal;
@@ -165,11 +163,4 @@ interface IFaceService {
    // hidlSensors must be non-null and empty. See AuthService.java
    // hidlSensors must be non-null and empty. See AuthService.java
    @EnforcePermission("USE_BIOMETRIC_INTERNAL")
    @EnforcePermission("USE_BIOMETRIC_INTERNAL")
    void registerAuthenticators(in List<FaceSensorPropertiesInternal> hidlSensors);
    void registerAuthenticators(in List<FaceSensorPropertiesInternal> hidlSensors);

    // Adds a callback which gets called when the service registers all of the face
    // authenticators. The callback is automatically removed after it's invoked.
    void addAuthenticatorsRegisteredCallback(IFaceAuthenticatorsRegisteredCallback callback);

    // Registers BiometricStateListener.
    void registerBiometricStateListener(IBiometricStateListener listener);
}
}
+0 −2
Original line number Original line Diff line number Diff line
@@ -202,10 +202,8 @@ interface IFingerprintService {
    void setSidefpsController(in ISidefpsController controller);
    void setSidefpsController(in ISidefpsController controller);


    // Registers BiometricStateListener.
    // Registers BiometricStateListener.
    @EnforcePermission("USE_BIOMETRIC_INTERNAL")
    void registerBiometricStateListener(IBiometricStateListener listener);
    void registerBiometricStateListener(IBiometricStateListener listener);


    // Sends a power button pressed event to all listeners.
    // Sends a power button pressed event to all listeners.
    @EnforcePermission("USE_BIOMETRIC_INTERNAL")
    oneway void onPowerPressed();
    oneway void onPowerPressed();
}
}
+2 −4
Original line number Original line Diff line number Diff line
@@ -54,7 +54,6 @@ import android.content.pm.ResolveInfo;
import android.content.pm.UserInfo;
import android.content.pm.UserInfo;
import android.database.ContentObserver;
import android.database.ContentObserver;
import android.hardware.SensorPrivacyManager;
import android.hardware.SensorPrivacyManager;
import android.hardware.biometrics.BiometricAuthenticator;
import android.hardware.biometrics.BiometricFingerprintConstants;
import android.hardware.biometrics.BiometricFingerprintConstants;
import android.hardware.biometrics.BiometricManager;
import android.hardware.biometrics.BiometricManager;
import android.hardware.biometrics.BiometricSourceType;
import android.hardware.biometrics.BiometricSourceType;
@@ -2019,13 +2018,12 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener, Dumpab
        // in case authenticators aren't registered yet at this point:
        // in case authenticators aren't registered yet at this point:
        mAuthController.addCallback(new AuthController.Callback() {
        mAuthController.addCallback(new AuthController.Callback() {
            @Override
            @Override
            public void onAllAuthenticatorsRegistered(
            public void onAllAuthenticatorsRegistered() {
                    @BiometricAuthenticator.Modality int modality) {
                mainExecutor.execute(() -> updateBiometricListeningState(BIOMETRIC_ACTION_UPDATE));
                mainExecutor.execute(() -> updateBiometricListeningState(BIOMETRIC_ACTION_UPDATE));
            }
            }


            @Override
            @Override
            public void onEnrollmentsChanged(@BiometricAuthenticator.Modality int modality) {
            public void onEnrollmentsChanged() {
                mainExecutor.execute(() -> updateBiometricListeningState(BIOMETRIC_ACTION_UPDATE));
                mainExecutor.execute(() -> updateBiometricListeningState(BIOMETRIC_ACTION_UPDATE));
            }
            }
        });
        });
Loading