gpt4 book ai didi

android - Fingerprint API 如何知道它已被调用?

转载 作者:行者123 更新时间:2023-11-29 18:29:48 24 4
gpt4 key购买 nike

我正在尝试学习如何实现指纹 API。

在其中一个指纹指南中,它给了我一个代码

@RequiresApi(api = Build.VERSION_CODES.P)
public class BiometricCallbackV28 extends BiometricPrompt.AuthenticationCallback {

private BiometricCallback biometricCallback;
public BiometricCallbackV28(BiometricCallback biometricCallback) {
this.biometricCallback = biometricCallback;
}


@Override
public void onAuthenticationSucceeded(BiometricPrompt.AuthenticationResult result) {
super.onAuthenticationSucceeded(result);
biometricCallback.onAuthenticationSuccessful();
}


@Override
public void onAuthenticationHelp(int helpCode, CharSequence helpString) {
super.onAuthenticationHelp(helpCode, helpString);
biometricCallback.onAuthenticationHelp(helpCode, helpString);
}


@Override
public void onAuthenticationError(int errorCode, CharSequence errString) {
super.onAuthenticationError(errorCode, errString);
biometricCallback.onAuthenticationError(errorCode, errString);
}


@Override
public void onAuthenticationFailed() {
super.onAuthenticationFailed();
biometricCallback.onAuthenticationFailed();
}
}

但是不应该测试验证是否通过然后调用 onAuthenticationSucceeded 吗?我没有看到任何调用 public void onAuthenticationSucceeded 的地方。它如何知道指纹匹配?谁调用该方法?

最佳答案

But shouldn't there be a test whether the authentication passed

系统通过将扫描的指纹与用户登记的指纹进行比对,判断是否通过认证

I don't see anywhere that calls public void onAuthenticationSucceeded

框架根据生物识别硬件的结果调用所有这些回调方法。

关于android - Fingerprint API 如何知道它已被调用?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56857763/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com