From eeadeaac028bdf4dc42fdba8ceeb9cc0c370d379 Mon Sep 17 00:00:00 2001 From: Kevin Chyn Date: Thu, 6 Feb 2020 16:27:41 -0800 Subject: [PATCH] Add API constant for BIOMETRIC_ERROR_SECURITY_UPDATE_REQUIRED Bug: 148419762 Test: make -j Test: See next CL Change-Id: I3c272792fe2366239478aa3ad7bfbb8d9bbacf56 --- api/current.txt | 2 ++ .../hardware/biometrics/BiometricConstants.java | 8 ++++++++ .../hardware/biometrics/BiometricFaceConstants.java | 10 ++++++++++ .../biometrics/BiometricFingerprintConstants.java | 10 ++++++++++ .../hardware/biometrics/BiometricManager.java | 12 +++++++++++- 5 files changed, 41 insertions(+), 1 deletion(-) diff --git a/api/current.txt b/api/current.txt index 87a5cd7a648bb..b2101002191a1 100644 --- a/api/current.txt +++ b/api/current.txt @@ -17018,6 +17018,7 @@ package android.hardware.biometrics { field public static final int BIOMETRIC_ERROR_HW_UNAVAILABLE = 1; // 0x1 field public static final int BIOMETRIC_ERROR_NONE_ENROLLED = 11; // 0xb field public static final int BIOMETRIC_ERROR_NO_HARDWARE = 12; // 0xc + field public static final int BIOMETRIC_ERROR_SECURITY_UPDATE_REQUIRED = 15; // 0xf field public static final int BIOMETRIC_SUCCESS = 0; // 0x0 } @@ -17052,6 +17053,7 @@ package android.hardware.biometrics { field public static final int BIOMETRIC_ERROR_NO_BIOMETRICS = 11; // 0xb field public static final int BIOMETRIC_ERROR_NO_DEVICE_CREDENTIAL = 14; // 0xe field public static final int BIOMETRIC_ERROR_NO_SPACE = 4; // 0x4 + field public static final int BIOMETRIC_ERROR_SECURITY_UPDATE_REQUIRED = 15; // 0xf field public static final int BIOMETRIC_ERROR_TIMEOUT = 3; // 0x3 field public static final int BIOMETRIC_ERROR_UNABLE_TO_PROCESS = 2; // 0x2 field public static final int BIOMETRIC_ERROR_USER_CANCELED = 10; // 0xa diff --git a/core/java/android/hardware/biometrics/BiometricConstants.java b/core/java/android/hardware/biometrics/BiometricConstants.java index 5a1365169eee6..add67aa436c64 100644 --- a/core/java/android/hardware/biometrics/BiometricConstants.java +++ b/core/java/android/hardware/biometrics/BiometricConstants.java @@ -131,6 +131,14 @@ public interface BiometricConstants { */ int BIOMETRIC_ERROR_NO_DEVICE_CREDENTIAL = 14; + /** + * A security vulnerability has been discovered and the sensor is unavailable until a + * security update has addressed this issue. This error can be received if for example, + * authentication was requested with {@link Authenticators#BIOMETRIC_STRONG}, but the + * sensor's strength can currently only meet {@link Authenticators#BIOMETRIC_WEAK}. + */ + int BIOMETRIC_ERROR_SECURITY_UPDATE_REQUIRED = 15; + /** * This constant is only used by SystemUI. It notifies SystemUI that authentication was paused * because the authentication attempt was unsuccessful. diff --git a/core/java/android/hardware/biometrics/BiometricFaceConstants.java b/core/java/android/hardware/biometrics/BiometricFaceConstants.java index bae0fd3ad3b98..6ba7c2a6e7e85 100644 --- a/core/java/android/hardware/biometrics/BiometricFaceConstants.java +++ b/core/java/android/hardware/biometrics/BiometricFaceConstants.java @@ -17,6 +17,7 @@ package android.hardware.biometrics; import android.app.KeyguardManager; +import android.hardware.biometrics.BiometricManager.Authenticators; import android.hardware.face.FaceManager; /** @@ -141,6 +142,15 @@ public interface BiometricFaceConstants { */ public static final int BIOMETRIC_ERROR_NO_DEVICE_CREDENTIAL = 14; + /** + * A security vulnerability has been discovered and the sensor is unavailable until a + * security update has addressed this issue. This error can be received if for example, + * authentication was requested with {@link Authenticators#BIOMETRIC_STRONG}, but the + * sensor's strength can currently only meet {@link Authenticators#BIOMETRIC_WEAK}. + * @hide + */ + int BIOMETRIC_ERROR_SECURITY_UPDATE_REQUIRED = 15; + /** * @hide */ diff --git a/core/java/android/hardware/biometrics/BiometricFingerprintConstants.java b/core/java/android/hardware/biometrics/BiometricFingerprintConstants.java index 5c74456eb60a2..0732d760daa9c 100644 --- a/core/java/android/hardware/biometrics/BiometricFingerprintConstants.java +++ b/core/java/android/hardware/biometrics/BiometricFingerprintConstants.java @@ -18,6 +18,7 @@ package android.hardware.biometrics; import android.app.KeyguardManager; import android.compat.annotation.UnsupportedAppUsage; +import android.hardware.biometrics.BiometricManager.Authenticators; import android.hardware.fingerprint.FingerprintManager; /** @@ -127,6 +128,15 @@ public interface BiometricFingerprintConstants { */ public static final int BIOMETRIC_ERROR_NO_DEVICE_CREDENTIAL = 14; + /** + * A security vulnerability has been discovered and the sensor is unavailable until a + * security update has addressed this issue. This error can be received if for example, + * authentication was requested with {@link Authenticators#BIOMETRIC_STRONG}, but the + * sensor's strength can currently only meet {@link Authenticators#BIOMETRIC_WEAK}. + * @hide + */ + public static final int BIOMETRIC_ERROR_SECURITY_UPDATE_REQUIRED = 15; + /** * @hide */ diff --git a/core/java/android/hardware/biometrics/BiometricManager.java b/core/java/android/hardware/biometrics/BiometricManager.java index 125b676e14f77..7d66cae4c8453 100644 --- a/core/java/android/hardware/biometrics/BiometricManager.java +++ b/core/java/android/hardware/biometrics/BiometricManager.java @@ -61,10 +61,20 @@ public class BiometricManager { public static final int BIOMETRIC_ERROR_NO_HARDWARE = BiometricConstants.BIOMETRIC_ERROR_HW_NOT_PRESENT; + /** + * A security vulnerability has been discovered and the sensor is unavailable until a + * security update has addressed this issue. This error can be received if for example, + * authentication was requested with {@link Authenticators#BIOMETRIC_STRONG}, but the + * sensor's strength can currently only meet {@link Authenticators#BIOMETRIC_WEAK}. + */ + public static final int BIOMETRIC_ERROR_SECURITY_UPDATE_REQUIRED = + BiometricConstants.BIOMETRIC_ERROR_SECURITY_UPDATE_REQUIRED; + @IntDef({BIOMETRIC_SUCCESS, BIOMETRIC_ERROR_HW_UNAVAILABLE, BIOMETRIC_ERROR_NONE_ENROLLED, - BIOMETRIC_ERROR_NO_HARDWARE}) + BIOMETRIC_ERROR_NO_HARDWARE, + BIOMETRIC_ERROR_SECURITY_UPDATE_REQUIRED}) @interface BiometricError {} /**