diff options
| -rwxr-xr-x | api/current.txt | 8 | ||||
| -rw-r--r-- | api/system-current.txt | 2 | ||||
| -rw-r--r-- | core/java/android/hardware/biometrics/BiometricConstants.java | 2 | ||||
| -rw-r--r-- | core/java/android/hardware/biometrics/BiometricManager.java | 26 | ||||
| -rw-r--r-- | services/core/java/com/android/server/biometrics/BiometricService.java | 4 |
5 files changed, 25 insertions, 17 deletions
diff --git a/api/current.txt b/api/current.txt index 870c0209d7c2..69b1ae951331 100755 --- a/api/current.txt +++ b/api/current.txt @@ -16068,10 +16068,10 @@ package android.hardware.biometrics { public class BiometricManager { method public int canAuthenticate(); - field public static final int ERROR_NONE = 0; // 0x0 - field public static final int ERROR_NO_BIOMETRICS = 11; // 0xb - field public static final int ERROR_NO_HARDWARE = 12; // 0xc - field public static final int ERROR_UNAVAILABLE = 1; // 0x1 + field public static final int BIOMETRIC_ERROR_NO_BIOMETRICS = 11; // 0xb + field public static final int BIOMETRIC_ERROR_NO_HARDWARE = 12; // 0xc + field public static final int BIOMETRIC_ERROR_UNAVAILABLE = 1; // 0x1 + field public static final int BIOMETRIC_SUCCESS = 0; // 0x0 } public class BiometricPrompt { diff --git a/api/system-current.txt b/api/system-current.txt index 7e510827b6ff..27554e31f1d4 100644 --- a/api/system-current.txt +++ b/api/system-current.txt @@ -987,8 +987,8 @@ package android.content { field public static final java.lang.String ACTION_PRE_BOOT_COMPLETED = "android.intent.action.PRE_BOOT_COMPLETED"; field public static final java.lang.String ACTION_QUERY_PACKAGE_RESTART = "android.intent.action.QUERY_PACKAGE_RESTART"; field public static final java.lang.String ACTION_RESOLVE_INSTANT_APP_PACKAGE = "android.intent.action.RESOLVE_INSTANT_APP_PACKAGE"; - field public static final java.lang.String ACTION_REVIEW_PERMISSION_USAGE = "android.intent.action.REVIEW_PERMISSION_USAGE"; field public static final java.lang.String ACTION_REVIEW_PERMISSIONS = "android.intent.action.REVIEW_PERMISSIONS"; + field public static final java.lang.String ACTION_REVIEW_PERMISSION_USAGE = "android.intent.action.REVIEW_PERMISSION_USAGE"; field public static final java.lang.String ACTION_SHOW_SUSPENDED_APP_DETAILS = "android.intent.action.SHOW_SUSPENDED_APP_DETAILS"; field public static final deprecated java.lang.String ACTION_SIM_STATE_CHANGED = "android.intent.action.SIM_STATE_CHANGED"; field public static final java.lang.String ACTION_SPLIT_CONFIGURATION_CHANGED = "android.intent.action.SPLIT_CONFIGURATION_CHANGED"; diff --git a/core/java/android/hardware/biometrics/BiometricConstants.java b/core/java/android/hardware/biometrics/BiometricConstants.java index 2a64c2e1e074..c814b7c67817 100644 --- a/core/java/android/hardware/biometrics/BiometricConstants.java +++ b/core/java/android/hardware/biometrics/BiometricConstants.java @@ -38,7 +38,7 @@ public interface BiometricConstants { * BiometricManager. * @hide */ - int BIOMETRIC_ERROR_NONE = 0; + int BIOMETRIC_SUCCESS = 0; /** * The hardware is unavailable. Try again later. diff --git a/core/java/android/hardware/biometrics/BiometricManager.java b/core/java/android/hardware/biometrics/BiometricManager.java index 1d400018d60c..fe006045bf0f 100644 --- a/core/java/android/hardware/biometrics/BiometricManager.java +++ b/core/java/android/hardware/biometrics/BiometricManager.java @@ -35,24 +35,31 @@ public class BiometricManager { /** * No error detected. */ - public static final int ERROR_NONE = BiometricConstants.BIOMETRIC_ERROR_NONE; + public static final int BIOMETRIC_SUCCESS = + BiometricConstants.BIOMETRIC_SUCCESS; /** * The hardware is unavailable. Try again later. */ - public static final int ERROR_UNAVAILABLE = BiometricConstants.BIOMETRIC_ERROR_HW_UNAVAILABLE; + public static final int BIOMETRIC_ERROR_UNAVAILABLE = + BiometricConstants.BIOMETRIC_ERROR_HW_UNAVAILABLE; /** * The user does not have any biometrics enrolled. */ - public static final int ERROR_NO_BIOMETRICS = BiometricConstants.BIOMETRIC_ERROR_NO_BIOMETRICS; + public static final int BIOMETRIC_ERROR_NO_BIOMETRICS = + BiometricConstants.BIOMETRIC_ERROR_NO_BIOMETRICS; /** * There is no biometric hardware. */ - public static final int ERROR_NO_HARDWARE = BiometricConstants.BIOMETRIC_ERROR_HW_NOT_PRESENT; + public static final int BIOMETRIC_ERROR_NO_HARDWARE = + BiometricConstants.BIOMETRIC_ERROR_HW_NOT_PRESENT; - @IntDef({ERROR_NONE, ERROR_UNAVAILABLE, ERROR_NO_BIOMETRICS, ERROR_NO_HARDWARE}) + @IntDef({BIOMETRIC_SUCCESS, + BIOMETRIC_ERROR_UNAVAILABLE, + BIOMETRIC_ERROR_NO_BIOMETRICS, + BIOMETRIC_ERROR_NO_HARDWARE}) @interface BiometricError {} private final Context mContext; @@ -72,9 +79,10 @@ public class BiometricManager { * Determine if biometrics can be used. In other words, determine if {@link BiometricPrompt} * can be expected to be shown (hardware available, templates enrolled, user-enabled). * - * @return Returns {@link #ERROR_NO_BIOMETRICS} if the user does not have any enrolled, or - * {@link #ERROR_UNAVAILABLE} if none are currently supported/enabled. Returns - * {@link #ERROR_NONE} if a biometric can currently be used (enrolled and available). + * @return Returns {@link #BIOMETRIC_ERROR_NO_BIOMETRICS} if the user does not have any + * enrolled, or {@link #BIOMETRIC_ERROR_UNAVAILABLE} if none are currently + * supported/enabled. Returns {@link #BIOMETRIC_SUCCESS} if a biometric can currently be + * used (enrolled and available). */ @RequiresPermission(USE_BIOMETRIC) public @BiometricError int canAuthenticate() { @@ -86,7 +94,7 @@ public class BiometricManager { } } else { Slog.w(TAG, "hasEnrolledBiometrics(): Service not connected"); - return ERROR_UNAVAILABLE; + return BIOMETRIC_ERROR_UNAVAILABLE; } } diff --git a/services/core/java/com/android/server/biometrics/BiometricService.java b/services/core/java/com/android/server/biometrics/BiometricService.java index b80dca6019fa..278c55f74ebb 100644 --- a/services/core/java/com/android/server/biometrics/BiometricService.java +++ b/services/core/java/com/android/server/biometrics/BiometricService.java @@ -272,7 +272,7 @@ public class BiometricService extends SystemService { final int error = result.second; // Check for errors, notify callback, and return - if (error != BiometricConstants.BIOMETRIC_ERROR_NONE) { + if (error != BiometricConstants.BIOMETRIC_SUCCESS) { try { final String hardwareUnavailable = getContext().getString(R.string.biometric_error_hw_unavailable); @@ -540,7 +540,7 @@ public class BiometricService extends SystemService { return new Pair<>(BIOMETRIC_NONE, BiometricConstants.BIOMETRIC_ERROR_HW_UNAVAILABLE); } - return new Pair<>(modality, BiometricConstants.BIOMETRIC_ERROR_NONE); + return new Pair<>(modality, BiometricConstants.BIOMETRIC_SUCCESS); } private boolean isEnabledForApp(int modality) { |