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

Commit 4efee6d8 authored by Kevin Chyn's avatar Kevin Chyn
Browse files

3/n: Add IntDefs for several biometric-related constants

Bug: 149067920

Test: Builds
Change-Id: I54ecc53a49f3545c14340b5471cc757adece5bc0
parent d4f14e8b
Loading
Loading
Loading
Loading
+9 −0
Original line number Original line Diff line number Diff line
@@ -17,11 +17,14 @@
package android.hardware.biometrics;
package android.hardware.biometrics;


import android.annotation.CallbackExecutor;
import android.annotation.CallbackExecutor;
import android.annotation.IntDef;
import android.annotation.NonNull;
import android.annotation.NonNull;
import android.hardware.biometrics.BiometricPrompt.AuthenticationResultType;
import android.hardware.biometrics.BiometricPrompt.AuthenticationResultType;
import android.os.CancellationSignal;
import android.os.CancellationSignal;
import android.os.Parcelable;
import android.os.Parcelable;


import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.util.concurrent.Executor;
import java.util.concurrent.Executor;


/**
/**
@@ -61,6 +64,12 @@ public interface BiometricAuthenticator {
     * @hide
     * @hide
     */
     */
    int TYPE_FACE = 1 << 3;
    int TYPE_FACE = 1 << 3;
    @IntDef({TYPE_NONE,
            TYPE_CREDENTIAL,
            TYPE_FINGERPRINT,
            TYPE_IRIS})
    @Retention(RetentionPolicy.SOURCE)
    @interface Modality {}


    /**
    /**
     * Container for biometric data
     * Container for biometric data
+25 −0
Original line number Original line Diff line number Diff line
@@ -18,8 +18,12 @@ package android.hardware.biometrics;


import static android.hardware.biometrics.BiometricManager.Authenticators;
import static android.hardware.biometrics.BiometricManager.Authenticators;


import android.annotation.IntDef;
import android.compat.annotation.UnsupportedAppUsage;
import android.compat.annotation.UnsupportedAppUsage;


import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;

/**
/**
 * Interface containing all of the biometric modality agnostic constants.
 * Interface containing all of the biometric modality agnostic constants.
 *
 *
@@ -152,6 +156,27 @@ public interface BiometricConstants {
    @UnsupportedAppUsage
    @UnsupportedAppUsage
    int BIOMETRIC_ERROR_VENDOR_BASE = 1000;
    int BIOMETRIC_ERROR_VENDOR_BASE = 1000;


    @IntDef({BIOMETRIC_SUCCESS,
            BIOMETRIC_ERROR_HW_UNAVAILABLE,
            BIOMETRIC_ERROR_UNABLE_TO_PROCESS,
            BIOMETRIC_ERROR_TIMEOUT,
            BIOMETRIC_ERROR_NO_SPACE,
            BIOMETRIC_ERROR_CANCELED,
            BIOMETRIC_ERROR_UNABLE_TO_REMOVE,
            BIOMETRIC_ERROR_LOCKOUT,
            BIOMETRIC_ERROR_VENDOR,
            BIOMETRIC_ERROR_LOCKOUT_PERMANENT,
            BIOMETRIC_ERROR_USER_CANCELED,
            BIOMETRIC_ERROR_NO_BIOMETRICS,
            BIOMETRIC_ERROR_HW_NOT_PRESENT,
            BIOMETRIC_ERROR_NEGATIVE_BUTTON,
            BIOMETRIC_ERROR_NO_DEVICE_CREDENTIAL,
            BIOMETRIC_ERROR_SECURITY_UPDATE_REQUIRED,
            BIOMETRIC_PAUSED_REJECTED,
            BIOMETRIC_ERROR_VENDOR_BASE})
    @Retention(RetentionPolicy.SOURCE)
    @interface Errors {}

    //
    //
    // Image acquisition messages.
    // Image acquisition messages.
    //
    //
+8 −1
Original line number Original line Diff line number Diff line
@@ -28,6 +28,9 @@ import android.content.Context;
import android.os.RemoteException;
import android.os.RemoteException;
import android.util.Slog;
import android.util.Slog;


import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;

/**
/**
 * A class that contains biometric utilities. For authentication, see {@link BiometricPrompt}.
 * A class that contains biometric utilities. For authentication, see {@link BiometricPrompt}.
 */
 */
@@ -69,12 +72,16 @@ public class BiometricManager {
    public static final int BIOMETRIC_ERROR_SECURITY_UPDATE_REQUIRED =
    public static final int BIOMETRIC_ERROR_SECURITY_UPDATE_REQUIRED =
            BiometricConstants.BIOMETRIC_ERROR_SECURITY_UPDATE_REQUIRED;
            BiometricConstants.BIOMETRIC_ERROR_SECURITY_UPDATE_REQUIRED;


    /**
     * @hide
     */
    @IntDef({BIOMETRIC_SUCCESS,
    @IntDef({BIOMETRIC_SUCCESS,
            BIOMETRIC_ERROR_HW_UNAVAILABLE,
            BIOMETRIC_ERROR_HW_UNAVAILABLE,
            BIOMETRIC_ERROR_NONE_ENROLLED,
            BIOMETRIC_ERROR_NONE_ENROLLED,
            BIOMETRIC_ERROR_NO_HARDWARE,
            BIOMETRIC_ERROR_NO_HARDWARE,
            BIOMETRIC_ERROR_SECURITY_UPDATE_REQUIRED})
            BIOMETRIC_ERROR_SECURITY_UPDATE_REQUIRED})
    @interface BiometricError {}
    @Retention(RetentionPolicy.SOURCE)
    public @interface BiometricError {}


    /**
    /**
     * Types of authenticators, defined at a level of granularity supported by
     * Types of authenticators, defined at a level of granularity supported by