mirror of
https://github.com/status-im/react-native-keychain.git
synced 2025-01-13 14:54:27 +00:00
Update DeviceAvailability to work with Android < 6 (#109)
Validate that the build version supports FingerprintManager before using it. Return false when not supported
This commit is contained in:
parent
009f7566a8
commit
61b6626f34
@ -7,12 +7,13 @@ import android.hardware.fingerprint.FingerprintManager;
|
||||
|
||||
public class DeviceAvailability {
|
||||
public static boolean isFingerprintAuthAvailable(Context context) {
|
||||
FingerprintManager fingerprintManager =
|
||||
if (android.os.Build.VERSION.SDK_INT >= 23) {
|
||||
FingerprintManager fingerprintManager =
|
||||
(FingerprintManager) context.getSystemService(Context.FINGERPRINT_SERVICE);
|
||||
|
||||
return android.os.Build.VERSION.SDK_INT >= 23 &&
|
||||
fingerprintManager.isHardwareDetected() &&
|
||||
fingerprintManager.hasEnrolledFingerprints();
|
||||
return fingerprintManager.isHardwareDetected() &&
|
||||
fingerprintManager.hasEnrolledFingerprints();
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public static boolean isSecure(Context context) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user