文章标题

来源:互联网 发布:python数据挖掘常用包 编辑:程序博客网 时间:2024/06/03 13:01
void FingerprintDaemonProxy::notifyKeystore(const uint8_t *auth_token, const size_t auth_token_length) {    if (auth_token != NULL && auth_token_length > 0) {        // TODO: cache service?        sp < IServiceManager > sm = defaultServiceManager();        sp < IBinder > binder = sm->getService(String16("android.security.keystore"));        sp < IKeystoreService > service = interface_cast < IKeystoreService > (binder);        if (service != NULL) {            status_t ret = service->addAuthToken(auth_token, auth_token_length);            if (ret != ResponseCode::NO_ERROR) {                ALOGE("Falure sending auth token to KeyStore: %d", ret);            }        } else {            ALOGE("Unable to communicate with KeyStore");        }    }}
void FingerprintDaemonProxy::hal_notify_callback(const fingerprint_msg_t *msg) {    switch (msg->type) {            case FINGERPRINT_AUTHENTICATED:            if (msg->data.authenticated.finger.fid != 0) {                const uint8_t* hat = reinterpret_cast<const uint8_t *>(&msg->data.authenticated.hat);                instance->notifyKeystore(hat, sizeof(msg->data.authenticated.hat));            }            callback->onAuthenticated(device,                    msg->data.authenticated.finger.fid,                    msg->data.authenticated.finger.gid);            break;    }}
void authenticate (FingerprintManager.CryptoObject crypto,                 CancellationSignal cancel,                 int flags,                 FingerprintManager.AuthenticationCallback callback,                 Handler handler)
0 0