summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Joshua Mccloskey <joshmccloskey@google.com> 2021-06-21 20:41:01 +0000
committer Android (Google) Code Review <android-gerrit@google.com> 2021-06-21 20:41:01 +0000
commit95b8d4bc80549f15acda62b76a967e2018d68bfd (patch)
tree1f0774f16b0f3a137168ba214431256e933a11ba
parented9701bbc86205dbe180acf4b4b46d4342e05ee0 (diff)
parentacf6fdf0ff8ee746810a7966c0af9a9f6a7624ce (diff)
Merge "Added fingerprint_bad_calibration." into sc-dev
-rw-r--r--core/java/android/hardware/biometrics/BiometricFingerprintConstants.java9
-rw-r--r--core/java/android/hardware/fingerprint/FingerprintManager.java3
-rw-r--r--core/res/res/values/strings.xml2
-rw-r--r--core/res/res/values/symbols.xml1
-rw-r--r--services/core/java/com/android/server/biometrics/sensors/fingerprint/aidl/AidlConversionUtils.java2
5 files changed, 16 insertions, 1 deletions
diff --git a/core/java/android/hardware/biometrics/BiometricFingerprintConstants.java b/core/java/android/hardware/biometrics/BiometricFingerprintConstants.java
index 79f716cd5ce9..2d46a4073809 100644
--- a/core/java/android/hardware/biometrics/BiometricFingerprintConstants.java
+++ b/core/java/android/hardware/biometrics/BiometricFingerprintConstants.java
@@ -60,7 +60,8 @@ public interface BiometricFingerprintConstants {
BIOMETRIC_ERROR_SECURITY_UPDATE_REQUIRED,
BIOMETRIC_ERROR_RE_ENROLL,
BIOMETRIC_ERROR_SECURITY_UPDATE_REQUIRED,
- FINGERPRINT_ERROR_UNKNOWN})
+ FINGERPRINT_ERROR_UNKNOWN,
+ FINGERPRINT_ERROR_BAD_CALIBARTION})
@Retention(RetentionPolicy.SOURCE)
@interface FingerprintError {}
@@ -181,6 +182,12 @@ public interface BiometricFingerprintConstants {
int FINGERPRINT_ERROR_UNKNOWN = 17;
/**
+ * Error indicating that the fingerprint sensor has bad calibration.
+ * @hide
+ */
+ int FINGERPRINT_ERROR_BAD_CALIBARTION = 18;
+
+ /**
* @hide
*/
@UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
diff --git a/core/java/android/hardware/fingerprint/FingerprintManager.java b/core/java/android/hardware/fingerprint/FingerprintManager.java
index e5946663df47..688f9f1174dd 100644
--- a/core/java/android/hardware/fingerprint/FingerprintManager.java
+++ b/core/java/android/hardware/fingerprint/FingerprintManager.java
@@ -1375,6 +1375,9 @@ public class FingerprintManager implements BiometricAuthenticator, BiometricFing
case BIOMETRIC_ERROR_SECURITY_UPDATE_REQUIRED:
return context.getString(
com.android.internal.R.string.fingerprint_error_security_update_required);
+ case FINGERPRINT_ERROR_BAD_CALIBARTION:
+ context.getString(
+ com.android.internal.R.string.fingerprint_error_bad_calibration);
case FINGERPRINT_ERROR_VENDOR: {
String[] msgArray = context.getResources().getStringArray(
com.android.internal.R.array.fingerprint_error_vendor);
diff --git a/core/res/res/values/strings.xml b/core/res/res/values/strings.xml
index bdeff89352ea..d4ddab1ec502 100644
--- a/core/res/res/values/strings.xml
+++ b/core/res/res/values/strings.xml
@@ -1636,6 +1636,8 @@
<string name="fingerprint_error_hw_not_present">This device does not have a fingerprint sensor.</string>
<!-- Generic error message shown when fingerprint is not available due to a security vulnerability. [CHAR LIMIT=50] -->
<string name="fingerprint_error_security_update_required">Sensor temporarily disabled.</string>
+ <!-- Generic error message shown when fingerprint needs calibration [CHAR LIMIT=50] -->
+ <string name="fingerprint_error_bad_calibration">Sensor needs calibration</string>
<!-- Template to be used to name enrolled fingerprints by default. -->
<string name="fingerprint_name_template">Finger <xliff:g id="fingerId" example="1">%d</xliff:g></string>
diff --git a/core/res/res/values/symbols.xml b/core/res/res/values/symbols.xml
index 97a2a38bdab8..960bd639960e 100644
--- a/core/res/res/values/symbols.xml
+++ b/core/res/res/values/symbols.xml
@@ -2537,6 +2537,7 @@
<java-symbol type="string" name="fingerprint_error_no_fingerprints" />
<java-symbol type="string" name="fingerprint_error_hw_not_present" />
<java-symbol type="string" name="fingerprint_error_security_update_required" />
+ <java-symbol type="string" name="fingerprint_error_bad_calibration" />
<!-- Fingerprint config -->
<java-symbol type="integer" name="config_fingerprintMaxTemplatesPerUser"/>
diff --git a/services/core/java/com/android/server/biometrics/sensors/fingerprint/aidl/AidlConversionUtils.java b/services/core/java/com/android/server/biometrics/sensors/fingerprint/aidl/AidlConversionUtils.java
index 66142bff0453..f1f94564c35d 100644
--- a/services/core/java/com/android/server/biometrics/sensors/fingerprint/aidl/AidlConversionUtils.java
+++ b/services/core/java/com/android/server/biometrics/sensors/fingerprint/aidl/AidlConversionUtils.java
@@ -46,6 +46,8 @@ final class AidlConversionUtils {
return BiometricFingerprintConstants.FINGERPRINT_ERROR_UNABLE_TO_REMOVE;
} else if (aidlError == Error.VENDOR) {
return BiometricFingerprintConstants.FINGERPRINT_ERROR_VENDOR;
+ } else if (aidlError == Error.BAD_CALIBRATION) {
+ return BiometricFingerprintConstants.FINGERPRINT_ERROR_BAD_CALIBARTION;
} else {
return BiometricFingerprintConstants.FINGERPRINT_ERROR_UNKNOWN;
}