1
0
Fork 0

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

This reverts commit 17d7928cc9.
master
Emily Kager 2020-03-02 13:36:05 -08:00 committed by Jeff Boek
parent db57e123b9
commit a61502215b
1 changed files with 9 additions and 17 deletions

View File

@ -146,23 +146,15 @@ class LoginsFragment : PreferenceFragmentCompat(), AccountObserver {
override fun onAuthenticationProblems() = updateSyncPreferenceNeedsReauth()
val isHardwareAvailable: Boolean by lazy {
// 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 -> {
false
}
if (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 {
false
}
}