samsung: hidl: fingerprint: call cancel on fingerprint enrollment completion
authorDanny Wood <danwood76@gmail.com>
Sat, 22 Feb 2020 06:36:04 +0000 (06:36 +0000)
committerJan Altensen <info@stricted.net>
Tue, 10 Mar 2020 14:42:01 +0000 (15:42 +0100)
Change-Id: I288613b772e3b31b86c7dffd5903dbe21ce5d5a9

hidl/fingerprint/Android.mk
hidl/fingerprint/BiometricsFingerprint.cpp

index 9070cd855640a4ff99280dc53f25f19ab0ee7f30..4af8e8b988cf16025dbebd8aaa16637f18996a95 100644 (file)
@@ -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
index f9b3d15f04cb3aa9fa83e728d1f3b464b208c02d..b38575de363363cd94bc411bc141067d5fb86f12 100644 (file)
@@ -302,6 +302,11 @@ void BiometricsFingerprint::notify(const fingerprint_msg_t* msg) {
 #ifdef USES_PERCENTAGE_SAMPLES
             const_cast<fingerprint_msg_t*>(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