This commit is contained in:
Adam Velebil 2023-02-10 08:55:39 +01:00
commit befaa85248
No known key found for this signature in database
GPG Key ID: C9B1E4A3CBBD2E10

View File

@ -19,6 +19,7 @@ package com.yubico.authenticator
import android.content.*
import android.content.SharedPreferences.OnSharedPreferenceChangeListener
import android.content.pm.PackageManager
import android.hardware.camera2.CameraCharacteristics
import android.hardware.camera2.CameraManager
import android.hardware.usb.UsbDevice
import android.hardware.usb.UsbManager
@ -377,7 +378,10 @@ class MainActivity : FlutterFragmentActivity() {
val cameraService =
getSystemService(Context.CAMERA_SERVICE) as CameraManager
result.success(
cameraService.cameraIdList.isNotEmpty()
cameraService.cameraIdList.any {
cameraService.getCameraCharacteristics(it)
.get(CameraCharacteristics.LENS_FACING) == CameraCharacteristics.LENS_FACING_BACK
}
)
}
"hasNfc" -> result.success(