In Android 10 devices, Biometric prompt is failing with ERROR_CANCELED all the time on top of lock screen

試著忘記壹切 提交于 2021-02-18 07:57:49

问题


In Android 10 devices, Biometric prompt is failing with BiometricPrompt.ERROR_CANCELED all the time on top of the lock screen. Error is returned in onAuthenticationError callback of BiometricPrompt.AuthenticationCallback class. The biometric prompt authentication is working when the device is unlocked.

is it possible to have biometric prompt authentication done on top of device lock screen in Android 10 when setDeviceCredentialAllowed is set to true?

Update: The issue is only when setDeviceCredentialAllowed is set to true. i.e if Devicekeyguard is made as fallback in BiometricPrompt , the authentication is not working on top of lock screen.


回答1:


An answer has been provided for this issue on the official tracker. Here is the gist as stated there as well:

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.



来源:https://stackoverflow.com/questions/59044309/in-android-10-devices-biometric-prompt-is-failing-with-error-canceled-all-the-t

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!