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

Commit 49fa609b authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge changes from topic "biometric-prompt-service"

* changes:
  Add BiometricPromptService
  Remove common biometric directory
parents 34929de7 a24e9fd9
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -151,6 +151,8 @@ java_library {
        ":libcamera_client_framework_aidl",
        "core/java/android/hardware/IConsumerIrService.aidl",
        "core/java/android/hardware/ISerialManager.aidl",
        "core/java/android/hardware/biometrics/IBiometricPromptService.aidl",
        "core/java/android/hardware/biometrics/IBiometricPromptServiceReceiver.aidl",
        "core/java/android/hardware/biometrics/IBiometricPromptReceiver.aidl",
        "core/java/android/hardware/biometrics/IBiometricServiceLockoutResetCallback.aidl",
        "core/java/android/hardware/display/IDisplayManager.aidl",
+9 −0
Original line number Diff line number Diff line
@@ -3671,6 +3671,15 @@ public abstract class Context {
     */
    public static final String AUDIO_SERVICE = "audio";

    /**
     * Use with {@link #getSystemService(String)}
     *
     * @hide
     * @see #getSystemService(String)
     * @see com.android.server.biometrics.BiometricPromptService
     */
    public static final String BIOMETRIC_PROMPT_SERVICE = "biometric_prompt";

    /**
     * Use with {@link #getSystemService(String)} to retrieve a
     * {@link android.hardware.fingerprint.FingerprintManager} for handling management
+8 −0
Original line number Diff line number Diff line
@@ -2279,6 +2279,14 @@ public abstract class PackageManager {
    @SdkConstant(SdkConstantType.FEATURE)
    public static final String FEATURE_FACE = "android.hardware.face";

    /**
     * Feature for {@link #getSystemAvailableFeatures} and
     * {@link #hasSystemFeature}: The device has biometric hardware to perform iris authentication.
     * @hide
     */
    @SdkConstant(SdkConstantType.FEATURE)
    public static final String FEATURE_IRIS = "android.hardware.iris";

    /**
     * Feature for {@link #getSystemAvailableFeatures} and
     * {@link #hasSystemFeature}: The device supports portrait orientation
+31 −10
Original line number Diff line number Diff line
@@ -160,12 +160,6 @@ public interface BiometricAuthenticator {
         */
        public void onAuthenticationHelp(int helpCode, CharSequence helpString) {}

        /**
         * Called when a biometric is recognized.
         * @param result An object containing authentication-related data
         */
        public void onAuthenticationSucceeded(AuthenticationResult result) {}

        /**
         * Called when a biometric is valid but not recognized.
         */
@@ -178,6 +172,29 @@ public interface BiometricAuthenticator {
        public void onAuthenticationAcquired(int acquireInfo) {}
    };

    /**
     * @return true if the biometric hardware is detected.
     */
    default boolean isHardwareDetected() {
        throw new UnsupportedOperationException("Stub!");
    }

    /**
     * @return true if the user has enrolled templates for this biometric.
     */
    default boolean hasEnrolledTemplates() {
        throw new UnsupportedOperationException("Stub!");
    }

    /**
     * @param error
     * @param vendorCode
     * @return the error string associated with this error
     */
    default String getErrorString(int error, int vendorCode) {
        throw new UnsupportedOperationException("Stub!");
    }

    /**
     * This call warms up the hardware and starts scanning for valid biometrics. It terminates
     * when {@link AuthenticationCallback#onAuthenticationError(int,
@@ -198,10 +215,12 @@ public interface BiometricAuthenticator {
     * @param executor An executor to handle callback events
     * @param callback An object to receive authentication events
     */
    void authenticate(@NonNull CryptoObject crypto,
    default void authenticate(@NonNull CryptoObject crypto,
            @NonNull CancellationSignal cancel,
            @NonNull @CallbackExecutor Executor executor,
            @NonNull AuthenticationCallback callback);
            @NonNull AuthenticationCallback callback) {
        throw new UnsupportedOperationException("Stub!");
    }

    /**
     * This call warms up the hardware and starts scanning for valid biometrics. It terminates
@@ -221,7 +240,9 @@ public interface BiometricAuthenticator {
     * @param executor An executor to handle callback events
     * @param callback An object to receive authentication events
     */
    void authenticate(@NonNull CancellationSignal cancel,
    default void authenticate(@NonNull CancellationSignal cancel,
            @NonNull @CallbackExecutor Executor executor,
            @NonNull AuthenticationCallback callback);
            @NonNull AuthenticationCallback callback) {
        throw new UnsupportedOperationException("Stub!");
    }
}
+1 −1
Original line number Diff line number Diff line
@@ -175,5 +175,5 @@ public interface BiometricConstants {
    /**
     * @hide
     */
    int BIOMETRICT_ACQUIRED_VENDOR_BASE = 1000;
    int BIOMETRIC_ACQUIRED_VENDOR_BASE = 1000;
}
Loading