在 Android 10 设备中,生物识别提示失败,并且始终在锁定屏幕顶部显示 BiometricPrompt.ERROR_CANCELED
。 BiometricPrompt.AuthenticationCallback
类的 onAuthenticationError
回调中返回错误。
当设备解锁时,生物识别提示身份验证正在工作。
当 setDeviceCredentialAllowed 设置为 true 时,是否可以在 Android 10 中的设备锁定屏幕顶部完成生物识别提示身份验证?
更新:仅当 setDeviceCredentialAllowed 设置为 true 时才会出现此问题。即,如果将 Devicekeyguard 作为 BiometricPrompt 中的后备,则身份验证将无法在锁定屏幕顶部进行。
最佳答案
An answer has been provided for this issue on the official tracker 。以下是其中所述的要点:
This is a side effect of launching on lockscreen, and is a known issue. Whenever an activity is allowed over lockscreen, it goes thorugh the lifecycle twice. In this case, since the first one went onPause, SystemServer stopped the authentication session.
This has been fixed in Android11, SysUI handles all of the authentication lifecycle now.
关于android - 在 Android 10 设备中,生物识别提示失败,并且锁屏顶部始终显示“错误已取消”,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59044309/