0

我按照此处所述并使用setDeviceCredentialAllowed(true)实现了新的androidx.biometric:biometric:1.0.1。在 API 29 上它可以正常工作,在 API < 29 上,当没有设置任何设备凭据时,我希望得到ERROR_NO_DEVICE_CREDENTIAL但我得到ERROR_USER_CANCELED,这是一个库错误,如果是,我在哪里可以报告这个?或者如果没有,我错过了什么?

由于文档说这个库是向后兼容的,我希望我不需要自己为 API<29 处理任何事情,对吧?

正如我在 BiometricPrompt.java 中看到的,有一个代码块:

        case DeviceCredentialHandlerBridge.RESULT_ERROR:
            // Device credential auth failed. Assume this is due to the user canceling.
            final CharSequence errorMsg = getActivity() != null
                    ? getActivity().getString(R.string.generic_error_user_canceled) : "";
            mAuthenticationCallback.onAuthenticationError(
                    BiometricConstants.ERROR_USER_CANCELED, errorMsg);
            bridge.stopIgnoringReset();
            bridge.reset();
            break;

虽然不知道进一步。

4

0 回答 0