hidl: biometrics: Extend UdfpsHandler with onAcquired and cancel methods
These methods can be used to handle vendor acquired messages and disable fod listening on cancelled and successful unlocks. Change-Id: Ie6a8d24840b0b6c34527f863a6052f789200a79f
This commit is contained in:
parent
5f0d7bbbe8
commit
c08b665831
@ -227,6 +227,9 @@ Return<uint64_t> BiometricsFingerprint::getAuthenticatorId() {
|
||||
}
|
||||
|
||||
Return<RequestStatus> BiometricsFingerprint::cancel() {
|
||||
if (mUdfpsHandler) {
|
||||
mUdfpsHandler->cancel();
|
||||
}
|
||||
return ErrorFilter(mDevice->cancel(mDevice));
|
||||
}
|
||||
|
||||
@ -354,6 +357,9 @@ void BiometricsFingerprint::notify(const fingerprint_msg_t* msg) {
|
||||
FingerprintAcquiredInfo result =
|
||||
VendorAcquiredFilter(msg->data.acquired.acquired_info, &vendorCode);
|
||||
ALOGD("onAcquired(%d)", result);
|
||||
if (thisPtr->mUdfpsHandler) {
|
||||
thisPtr->mUdfpsHandler->onAcquired(static_cast<int32_t>(result), vendorCode);
|
||||
}
|
||||
if (!thisPtr->mClientCallback->onAcquired(devId, result, vendorCode).isOk()) {
|
||||
ALOGE("failed to invoke fingerprint onAcquired callback");
|
||||
}
|
||||
|
@ -16,6 +16,9 @@ class UdfpsHandler {
|
||||
virtual void init(fingerprint_device_t *device) = 0;
|
||||
virtual void onFingerDown(uint32_t x, uint32_t y, float minor, float major) = 0;
|
||||
virtual void onFingerUp() = 0;
|
||||
|
||||
virtual void onAcquired(int32_t result, int32_t vendorCode) = 0;
|
||||
virtual void cancel() = 0;
|
||||
};
|
||||
|
||||
struct UdfpsHandlerFactory {
|
||||
|
Loading…
Reference in New Issue
Block a user