android - 在 Android 10 设备中,生物识别提示失败,并且锁屏顶部始终显示“错误已取消”

标签 android lockscreen android-10.0 android-biometric-prompt android-biometric

在 Android 10 设备中,生物识别提示失败,并且始终在锁定屏幕顶部显示 BiometricPrompt.ERROR_CANCELEDBiometricPrompt.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/

相关文章:

android - Evernote 如何在 Android 上实现他们的富文本编辑器?

android - 无法初始化类 android.support.design.widget.CoordinatorLayout

iOS 私有(private) API : lock device and power off the screen

android - Android 实际上在哪里调用 "ip link"或 "ifconfig"来启动界面?

android - 在使用 Android Q 的 Android 模拟器上运行 flutter 应用程序时如何修复 'HttpException' 错误?

android - 在 Android Q 上查询 MediaStore

java - 我无法让我的对话框复选框在 android studio 中工作

android - 添加到 WindowManager 的自定义 View 上的动画

android - 如何在锁屏中设置全屏专辑封面?

javascript - 移动 Safari 独立模式下的可见性变化