From e893e32fe5b4bc66f9564f8881d84f1543a6afec Mon Sep 17 00:00:00 2001 From: Danny Wood Date: Sat, 22 Feb 2020 06:36:04 +0000 Subject: [PATCH] samsung: hidl: fingerprint: call cancel on fingerprint enrollment completion Change-Id: I288613b772e3b31b86c7dffd5903dbe21ce5d5a9 --- hidl/fingerprint/Android.mk | 4 ++++ hidl/fingerprint/BiometricsFingerprint.cpp | 5 +++++ 2 files changed, 9 insertions(+) diff --git a/hidl/fingerprint/Android.mk b/hidl/fingerprint/Android.mk index 9070cd85..4af8e8b9 100644 --- a/hidl/fingerprint/Android.mk +++ b/hidl/fingerprint/Android.mk @@ -39,6 +39,10 @@ ifeq ($(TARGET_SEC_FP_USES_PERCENTAGE_SAMPLES),true) LOCAL_CFLAGS += -DUSES_PERCENTAGE_SAMPLES endif +ifeq ($(TARGET_SEC_FP_CALL_CANCEL_ON_ENROLL_COMPLETION),true) + LOCAL_CFLAGS += -DCALL_CANCEL_ON_ENROLL_COMPLETION +endif + LOCAL_MODULE := android.hardware.biometrics.fingerprint@2.1-service.samsung LOCAL_INIT_RC := android.hardware.biometrics.fingerprint@2.1-service.samsung.rc LOCAL_MODULE_RELATIVE_PATH := hw diff --git a/hidl/fingerprint/BiometricsFingerprint.cpp b/hidl/fingerprint/BiometricsFingerprint.cpp index f9b3d15f..b38575de 100644 --- a/hidl/fingerprint/BiometricsFingerprint.cpp +++ b/hidl/fingerprint/BiometricsFingerprint.cpp @@ -302,6 +302,11 @@ void BiometricsFingerprint::notify(const fingerprint_msg_t* msg) { #ifdef USES_PERCENTAGE_SAMPLES const_cast(msg)->data.enroll.samples_remaining = 100 - msg->data.enroll.samples_remaining; +#endif +#ifdef CALL_CANCEL_ON_ENROLL_COMPLETION + if(msg->data.enroll.samples_remaining == 0) { + thisPtr->ss_fingerprint_cancel(); + } #endif LOG(DEBUG) << "onEnrollResult(fid=" << msg->data.enroll.finger.fid << ", gid=" << msg->data.enroll.finger.gid