mirror of
https://github.com/status-im/react-native-keychain.git
synced 2025-01-27 21:45:28 +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 class DeviceAvailability {
|
||||||
public static boolean isFingerprintAuthAvailable(Context context) {
|
public static boolean isFingerprintAuthAvailable(Context context) {
|
||||||
FingerprintManager fingerprintManager =
|
if (android.os.Build.VERSION.SDK_INT >= 23) {
|
||||||
|
FingerprintManager fingerprintManager =
|
||||||
(FingerprintManager) context.getSystemService(Context.FINGERPRINT_SERVICE);
|
(FingerprintManager) context.getSystemService(Context.FINGERPRINT_SERVICE);
|
||||||
|
return fingerprintManager.isHardwareDetected() &&
|
||||||
return android.os.Build.VERSION.SDK_INT >= 23 &&
|
fingerprintManager.hasEnrolledFingerprints();
|
||||||
fingerprintManager.isHardwareDetected() &&
|
}
|
||||||
fingerprintManager.hasEnrolledFingerprints();
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static boolean isSecure(Context context) {
|
public static boolean isSecure(Context context) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user