Add missing parameters to notifyAcquired and notifyError
Adds missing acquireInfo and errorCode parameters
Bug: 169459906
Test: make -j update-api && make -j
Change-Id: I8cae7662e9d4ad7dad6064365479d0e08b7e4d11
diff --git a/api/test-current.txt b/api/test-current.txt
index d61526a..0492ce8 100644
--- a/api/test-current.txt
+++ b/api/test-current.txt
@@ -1272,8 +1272,8 @@
method @RequiresPermission(android.Manifest.permission.TEST_BIOMETRIC) public void cleanupInternalState(int);
method @RequiresPermission(android.Manifest.permission.TEST_BIOMETRIC) public void close();
method @RequiresPermission(android.Manifest.permission.TEST_BIOMETRIC) public void finishEnroll(int);
- method @RequiresPermission(android.Manifest.permission.TEST_BIOMETRIC) public void notifyAcquired(int);
- method @RequiresPermission(android.Manifest.permission.TEST_BIOMETRIC) public void notifyError(int);
+ method @RequiresPermission(android.Manifest.permission.TEST_BIOMETRIC) public void notifyAcquired(int, int);
+ method @RequiresPermission(android.Manifest.permission.TEST_BIOMETRIC) public void notifyError(int, int);
method @RequiresPermission(android.Manifest.permission.TEST_BIOMETRIC) public void rejectAuthentication(int);
method @RequiresPermission(android.Manifest.permission.TEST_BIOMETRIC) public void startEnroll(int);
}
diff --git a/core/java/android/hardware/biometrics/BiometricConstants.java b/core/java/android/hardware/biometrics/BiometricConstants.java
index 3040932..bed9a06 100644
--- a/core/java/android/hardware/biometrics/BiometricConstants.java
+++ b/core/java/android/hardware/biometrics/BiometricConstants.java
@@ -172,8 +172,7 @@
BIOMETRIC_ERROR_NEGATIVE_BUTTON,
BIOMETRIC_ERROR_NO_DEVICE_CREDENTIAL,
BIOMETRIC_ERROR_SECURITY_UPDATE_REQUIRED,
- BIOMETRIC_PAUSED_REJECTED,
- BIOMETRIC_ERROR_VENDOR_BASE})
+ BIOMETRIC_PAUSED_REJECTED})
@Retention(RetentionPolicy.SOURCE)
@interface Errors {}
@@ -182,6 +181,19 @@
//
/**
+ * @hide
+ */
+ @IntDef({BIOMETRIC_ACQUIRED_GOOD,
+ BIOMETRIC_ACQUIRED_PARTIAL,
+ BIOMETRIC_ACQUIRED_INSUFFICIENT,
+ BIOMETRIC_ACQUIRED_IMAGER_DIRTY,
+ BIOMETRIC_ACQUIRED_TOO_SLOW,
+ BIOMETRIC_ACQUIRED_TOO_FAST,
+ BIOMETRIC_ACQUIRED_VENDOR})
+ @Retention(RetentionPolicy.SOURCE)
+ @interface Acquired {}
+
+ /**
* The image acquired was good.
*/
int BIOMETRIC_ACQUIRED_GOOD = 0;
diff --git a/core/java/android/hardware/biometrics/BiometricFingerprintConstants.java b/core/java/android/hardware/biometrics/BiometricFingerprintConstants.java
index 46e8cc0..c7b554b 100644
--- a/core/java/android/hardware/biometrics/BiometricFingerprintConstants.java
+++ b/core/java/android/hardware/biometrics/BiometricFingerprintConstants.java
@@ -16,11 +16,15 @@
package android.hardware.biometrics;
+import android.annotation.IntDef;
import android.app.KeyguardManager;
import android.compat.annotation.UnsupportedAppUsage;
import android.hardware.biometrics.BiometricManager.Authenticators;
import android.hardware.fingerprint.FingerprintManager;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+
/**
* Interface containing all of the fingerprint-specific constants.
*
@@ -36,6 +40,27 @@
//
/**
+ * @hide
+ */
+ @IntDef({FINGERPRINT_ERROR_HW_UNAVAILABLE,
+ FINGERPRINT_ERROR_UNABLE_TO_PROCESS,
+ FINGERPRINT_ERROR_TIMEOUT,
+ FINGERPRINT_ERROR_NO_SPACE,
+ FINGERPRINT_ERROR_CANCELED,
+ FINGERPRINT_ERROR_UNABLE_TO_REMOVE,
+ FINGERPRINT_ERROR_LOCKOUT,
+ FINGERPRINT_ERROR_VENDOR,
+ FINGERPRINT_ERROR_LOCKOUT_PERMANENT,
+ FINGERPRINT_ERROR_USER_CANCELED,
+ FINGERPRINT_ERROR_NO_FINGERPRINTS,
+ FINGERPRINT_ERROR_HW_NOT_PRESENT,
+ FINGERPRINT_ERROR_NEGATIVE_BUTTON,
+ BIOMETRIC_ERROR_NO_DEVICE_CREDENTIAL,
+ BIOMETRIC_ERROR_SECURITY_UPDATE_REQUIRED})
+ @Retention(RetentionPolicy.SOURCE)
+ @interface FingerprintError {}
+
+ /**
* The hardware is unavailable. Try again later.
*/
int FINGERPRINT_ERROR_HW_UNAVAILABLE = 1;
@@ -150,6 +175,20 @@
//
/**
+ * @hide
+ */
+ @IntDef({FINGERPRINT_ACQUIRED_GOOD,
+ FINGERPRINT_ACQUIRED_PARTIAL,
+ FINGERPRINT_ACQUIRED_INSUFFICIENT,
+ FINGERPRINT_ACQUIRED_IMAGER_DIRTY,
+ FINGERPRINT_ACQUIRED_TOO_SLOW,
+ FINGERPRINT_ACQUIRED_TOO_FAST,
+ FINGERPRINT_ACQUIRED_VENDOR,
+ FINGERPRINT_ACQUIRED_START})
+ @Retention(RetentionPolicy.SOURCE)
+ @interface FingerprintAcquired {}
+
+ /**
* The image acquired was good.
*/
int FINGERPRINT_ACQUIRED_GOOD = 0;
diff --git a/core/java/android/hardware/biometrics/BiometricTestSession.java b/core/java/android/hardware/biometrics/BiometricTestSession.java
index 4c7aa27..802655b 100644
--- a/core/java/android/hardware/biometrics/BiometricTestSession.java
+++ b/core/java/android/hardware/biometrics/BiometricTestSession.java
@@ -22,6 +22,7 @@
import android.annotation.RequiresPermission;
import android.annotation.TestApi;
import android.content.Context;
+import android.hardware.fingerprint.FingerprintManager;
import android.os.RemoteException;
import android.util.ArraySet;
@@ -128,11 +129,14 @@
* Simulates an acquired message from the HAL.
*
* @param userId User that this command applies to.
+ * @param acquireInfo See
+ * {@link BiometricPrompt.AuthenticationCallback#onAuthenticationAcquired(int)} and
+ * {@link FingerprintManager.AuthenticationCallback#onAuthenticationAcquired(int)}
*/
@RequiresPermission(TEST_BIOMETRIC)
- public void notifyAcquired(int userId) {
+ public void notifyAcquired(int userId, int acquireInfo) {
try {
- mTestSession.notifyAcquired(userId);
+ mTestSession.notifyAcquired(userId, acquireInfo);
} catch (RemoteException e) {
throw e.rethrowFromSystemServer();
}
@@ -142,11 +146,14 @@
* Simulates an error message from the HAL.
*
* @param userId User that this command applies to.
+ * @param errorCode See
+ * {@link BiometricPrompt.AuthenticationCallback#onAuthenticationError(int, CharSequence)} and
+ * {@link FingerprintManager.AuthenticationCallback#onAuthenticationError(int, CharSequence)}
*/
@RequiresPermission(TEST_BIOMETRIC)
- public void notifyError(int userId) {
+ public void notifyError(int userId, int errorCode) {
try {
- mTestSession.notifyError(userId);
+ mTestSession.notifyError(userId, errorCode);
} catch (RemoteException e) {
throw e.rethrowFromSystemServer();
}
diff --git a/core/java/android/hardware/biometrics/ITestSession.aidl b/core/java/android/hardware/biometrics/ITestSession.aidl
index 5677f65..6112f17 100644
--- a/core/java/android/hardware/biometrics/ITestSession.aidl
+++ b/core/java/android/hardware/biometrics/ITestSession.aidl
@@ -42,10 +42,10 @@
void rejectAuthentication(int userId);
// Simulates an acquired message from the HAL.
- void notifyAcquired(int userId);
+ void notifyAcquired(int userId, int acquireInfo);
// Simulates an error message from the HAL.
- void notifyError(int userId);
+ void notifyError(int userId, int errorCode);
// Matches the framework's cached enrollments against the HAL's enrollments. Any enrollment
// that isn't known by both sides are deleted. This should generally be used when the test
diff --git a/services/core/java/com/android/server/biometrics/sensors/fingerprint/FingerprintService.java b/services/core/java/com/android/server/biometrics/sensors/fingerprint/FingerprintService.java
index 1f71d78..5dcadee 100644
--- a/services/core/java/com/android/server/biometrics/sensors/fingerprint/FingerprintService.java
+++ b/services/core/java/com/android/server/biometrics/sensors/fingerprint/FingerprintService.java
@@ -127,12 +127,12 @@
}
@Override
- public void notifyAcquired(int userId) {
+ public void notifyAcquired(int userId, int acquireInfo) {
Utils.checkPermission(getContext(), TEST_BIOMETRIC);
}
@Override
- public void notifyError(int userId) {
+ public void notifyError(int userId, int errorCode) {
Utils.checkPermission(getContext(), TEST_BIOMETRIC);
}