Skip to content

Commit 1dc74b1

Browse files
committed
build: upgrade AndroidX biometric
The BiometricConstants class was removed and these were folded into BiometricPrompt. Signed-off-by: Jason A. Donenfeld <[email protected]>
1 parent 9266487 commit 1dc74b1

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ buildscript {
55
annotationsVersion = '1.1.0'
66
appcompatVersion = '1.2.0'
77
bintrayPluginVersion = '1.8.5'
8-
biometricVersion = '1.1.0-alpha02'
8+
biometricVersion = '1.1.0-beta01'
99
collectionVersion = '1.1.0'
1010
constraintLayoutVersion = '2.0.1'
1111
coordinatorLayoutVersion = '1.1.0'

ui/src/main/java/com/wireguard/android/util/BiometricAuthenticator.kt

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ import android.os.Handler
99
import android.os.Looper
1010
import android.util.Log
1111
import androidx.annotation.StringRes
12-
import androidx.biometric.BiometricConstants
1312
import androidx.biometric.BiometricManager
1413
import androidx.biometric.BiometricManager.Authenticators
1514
import androidx.biometric.BiometricPrompt
@@ -41,12 +40,12 @@ object BiometricAuthenticator {
4140
super.onAuthenticationError(errorCode, errString)
4241
Log.d(TAG, "BiometricAuthentication error: errorCode=$errorCode, msg=$errString")
4342
callback(when (errorCode) {
44-
BiometricConstants.ERROR_CANCELED, BiometricConstants.ERROR_USER_CANCELED,
45-
BiometricConstants.ERROR_NEGATIVE_BUTTON -> {
43+
BiometricPrompt.ERROR_CANCELED, BiometricPrompt.ERROR_USER_CANCELED,
44+
BiometricPrompt.ERROR_NEGATIVE_BUTTON -> {
4645
Result.Cancelled
4746
}
48-
BiometricConstants.ERROR_HW_NOT_PRESENT, BiometricConstants.ERROR_HW_UNAVAILABLE,
49-
BiometricConstants.ERROR_NO_BIOMETRICS, BiometricConstants.ERROR_NO_DEVICE_CREDENTIAL -> {
47+
BiometricPrompt.ERROR_HW_NOT_PRESENT, BiometricPrompt.ERROR_HW_UNAVAILABLE,
48+
BiometricPrompt.ERROR_NO_BIOMETRICS, BiometricPrompt.ERROR_NO_DEVICE_CREDENTIAL -> {
5049
Result.HardwareUnavailableOrDisabled
5150
}
5251
else -> Result.Failure(errorCode, fragment.getString(R.string.biometric_auth_error_reason, errString))

0 commit comments

Comments
 (0)