1
0
Fork 0

For #7603 - Temporarily do not show biometric prompt for OnePlus devices

master
Emily Kager 2020-02-07 18:24:44 +01:00 committed by Jeff Boek
parent ca60e3fbe3
commit 17d7928cc9
1 changed files with 17 additions and 9 deletions

View File

@ -140,17 +140,25 @@ class LoginsFragment : PreferenceFragmentCompat(), AccountObserver {
override fun onAuthenticationProblems() = updateSyncPreferenceNeedsReauth()
val isHardwareAvailable: Boolean by lazy {
if (Build.VERSION.SDK_INT >= M) {
// Temporary fix for certain devices that can't use the current biometrics library
// https://github.com/mozilla-mobile/fenix/issues/7603
when {
Build.MANUFACTURER.toLowerCase().contains("oneplus") -> {
false
}
Build.VERSION.SDK_INT >= M -> {
context?.let {
val bm = BiometricManager.from(it)
val canAuthenticate = bm.canAuthenticate()
!(canAuthenticate == BiometricManager.BIOMETRIC_ERROR_NO_HARDWARE ||
canAuthenticate == BiometricManager.BIOMETRIC_ERROR_HW_UNAVAILABLE)
} ?: false
} else {
}
else -> {
false
}
}
}
val hasBiometricEnrolled: Boolean by lazy {
if (Build.VERSION.SDK_INT >= M) {