Loading core/java/android/hardware/biometrics/BiometricFingerprintConstants.java +2 −2 Original line number Diff line number Diff line Loading @@ -61,7 +61,7 @@ public interface BiometricFingerprintConstants { BIOMETRIC_ERROR_RE_ENROLL, BIOMETRIC_ERROR_SECURITY_UPDATE_REQUIRED, FINGERPRINT_ERROR_UNKNOWN, FINGERPRINT_ERROR_BAD_CALIBARTION}) FINGERPRINT_ERROR_BAD_CALIBRATION}) @Retention(RetentionPolicy.SOURCE) @interface FingerprintError {} Loading Loading @@ -185,7 +185,7 @@ public interface BiometricFingerprintConstants { * Error indicating that the fingerprint sensor has bad calibration. * @hide */ int FINGERPRINT_ERROR_BAD_CALIBARTION = 18; int FINGERPRINT_ERROR_BAD_CALIBRATION = 18; /** * @hide Loading core/java/android/hardware/fingerprint/FingerprintManager.java +1 −1 Original line number Diff line number Diff line Loading @@ -1375,7 +1375,7 @@ 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: case FINGERPRINT_ERROR_BAD_CALIBRATION: return context.getString( com.android.internal.R.string.fingerprint_error_bad_calibration); case FINGERPRINT_ERROR_VENDOR: { Loading services/core/java/com/android/server/biometrics/sensors/BiometricNotificationUtils.java +16 −2 Original line number Diff line number Diff line Loading @@ -23,7 +23,9 @@ import android.app.NotificationManager; import android.app.PendingIntent; import android.content.Context; import android.content.Intent; import android.os.SystemClock; import android.os.UserHandle; import android.util.Slog; import com.android.internal.R; Loading @@ -32,9 +34,12 @@ import com.android.internal.R; */ public class BiometricNotificationUtils { private static final String TAG = "BiometricNotificationUtils"; private static final String RE_ENROLL_NOTIFICATION_TAG = "FaceService"; private static final String BAD_CALIBRATION_NOTIFICATION_TAG = "FingerprintService"; private static final int NOTIFICATION_ID = 1; private static final long NOTIFICATION_INTERVAL_MS = 24 * 60 * 60 * 1000; private static long sLastAlertTime = 0; /** * Shows a face re-enrollment notification. Loading Loading @@ -67,8 +72,17 @@ public class BiometricNotificationUtils { * Shows a fingerprint bad calibration notification. */ public static void showBadCalibrationNotification(@NonNull Context context) { final NotificationManager notificationManager = context.getSystemService(NotificationManager.class); final long currentTime = SystemClock.elapsedRealtime(); final long timeSinceLastAlert = currentTime - sLastAlertTime; // Only show the notification if not previously shown or a day has // passed since the last notification. if (sLastAlertTime != 0 && (timeSinceLastAlert < NOTIFICATION_INTERVAL_MS)) { Slog.v(TAG, "Skipping calibration notification : " + timeSinceLastAlert); return; } sLastAlertTime = currentTime; final String name = context.getString(R.string.fingerprint_recalibrate_notification_name); Loading services/core/java/com/android/server/biometrics/sensors/fingerprint/aidl/AidlConversionUtils.java +1 −1 Original line number Diff line number Diff line Loading @@ -47,7 +47,7 @@ final class AidlConversionUtils { } else if (aidlError == Error.VENDOR) { return BiometricFingerprintConstants.FINGERPRINT_ERROR_VENDOR; } else if (aidlError == Error.BAD_CALIBRATION) { return BiometricFingerprintConstants.FINGERPRINT_ERROR_BAD_CALIBARTION; return BiometricFingerprintConstants.FINGERPRINT_ERROR_BAD_CALIBRATION; } else { return BiometricFingerprintConstants.FINGERPRINT_ERROR_UNKNOWN; } Loading services/core/java/com/android/server/biometrics/sensors/fingerprint/aidl/FingerprintAuthenticationClient.java +1 −1 Original line number Diff line number Diff line Loading @@ -112,7 +112,7 @@ class FingerprintAuthenticationClient extends AuthenticationClient<ISession> imp public void onError(int errorCode, int vendorCode) { super.onError(errorCode, vendorCode); if (errorCode == BiometricFingerprintConstants.FINGERPRINT_ERROR_BAD_CALIBARTION) { if (errorCode == BiometricFingerprintConstants.FINGERPRINT_ERROR_BAD_CALIBRATION) { BiometricNotificationUtils.showBadCalibrationNotification(getContext()); } Loading Loading
core/java/android/hardware/biometrics/BiometricFingerprintConstants.java +2 −2 Original line number Diff line number Diff line Loading @@ -61,7 +61,7 @@ public interface BiometricFingerprintConstants { BIOMETRIC_ERROR_RE_ENROLL, BIOMETRIC_ERROR_SECURITY_UPDATE_REQUIRED, FINGERPRINT_ERROR_UNKNOWN, FINGERPRINT_ERROR_BAD_CALIBARTION}) FINGERPRINT_ERROR_BAD_CALIBRATION}) @Retention(RetentionPolicy.SOURCE) @interface FingerprintError {} Loading Loading @@ -185,7 +185,7 @@ public interface BiometricFingerprintConstants { * Error indicating that the fingerprint sensor has bad calibration. * @hide */ int FINGERPRINT_ERROR_BAD_CALIBARTION = 18; int FINGERPRINT_ERROR_BAD_CALIBRATION = 18; /** * @hide Loading
core/java/android/hardware/fingerprint/FingerprintManager.java +1 −1 Original line number Diff line number Diff line Loading @@ -1375,7 +1375,7 @@ 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: case FINGERPRINT_ERROR_BAD_CALIBRATION: return context.getString( com.android.internal.R.string.fingerprint_error_bad_calibration); case FINGERPRINT_ERROR_VENDOR: { Loading
services/core/java/com/android/server/biometrics/sensors/BiometricNotificationUtils.java +16 −2 Original line number Diff line number Diff line Loading @@ -23,7 +23,9 @@ import android.app.NotificationManager; import android.app.PendingIntent; import android.content.Context; import android.content.Intent; import android.os.SystemClock; import android.os.UserHandle; import android.util.Slog; import com.android.internal.R; Loading @@ -32,9 +34,12 @@ import com.android.internal.R; */ public class BiometricNotificationUtils { private static final String TAG = "BiometricNotificationUtils"; private static final String RE_ENROLL_NOTIFICATION_TAG = "FaceService"; private static final String BAD_CALIBRATION_NOTIFICATION_TAG = "FingerprintService"; private static final int NOTIFICATION_ID = 1; private static final long NOTIFICATION_INTERVAL_MS = 24 * 60 * 60 * 1000; private static long sLastAlertTime = 0; /** * Shows a face re-enrollment notification. Loading Loading @@ -67,8 +72,17 @@ public class BiometricNotificationUtils { * Shows a fingerprint bad calibration notification. */ public static void showBadCalibrationNotification(@NonNull Context context) { final NotificationManager notificationManager = context.getSystemService(NotificationManager.class); final long currentTime = SystemClock.elapsedRealtime(); final long timeSinceLastAlert = currentTime - sLastAlertTime; // Only show the notification if not previously shown or a day has // passed since the last notification. if (sLastAlertTime != 0 && (timeSinceLastAlert < NOTIFICATION_INTERVAL_MS)) { Slog.v(TAG, "Skipping calibration notification : " + timeSinceLastAlert); return; } sLastAlertTime = currentTime; final String name = context.getString(R.string.fingerprint_recalibrate_notification_name); Loading
services/core/java/com/android/server/biometrics/sensors/fingerprint/aidl/AidlConversionUtils.java +1 −1 Original line number Diff line number Diff line Loading @@ -47,7 +47,7 @@ final class AidlConversionUtils { } else if (aidlError == Error.VENDOR) { return BiometricFingerprintConstants.FINGERPRINT_ERROR_VENDOR; } else if (aidlError == Error.BAD_CALIBRATION) { return BiometricFingerprintConstants.FINGERPRINT_ERROR_BAD_CALIBARTION; return BiometricFingerprintConstants.FINGERPRINT_ERROR_BAD_CALIBRATION; } else { return BiometricFingerprintConstants.FINGERPRINT_ERROR_UNKNOWN; } Loading
services/core/java/com/android/server/biometrics/sensors/fingerprint/aidl/FingerprintAuthenticationClient.java +1 −1 Original line number Diff line number Diff line Loading @@ -112,7 +112,7 @@ class FingerprintAuthenticationClient extends AuthenticationClient<ISession> imp public void onError(int errorCode, int vendorCode) { super.onError(errorCode, vendorCode); if (errorCode == BiometricFingerprintConstants.FINGERPRINT_ERROR_BAD_CALIBARTION) { if (errorCode == BiometricFingerprintConstants.FINGERPRINT_ERROR_BAD_CALIBRATION) { BiometricNotificationUtils.showBadCalibrationNotification(getContext()); } Loading