fingerprint: allow to request force calibration
authorJesse Chan <jc@lineageos.org>
Sat, 15 Aug 2020 07:41:24 +0000 (15:41 +0800)
committerTim Zimmermann <tim@linux4.de>
Mon, 2 May 2022 15:58:51 +0000 (17:58 +0200)
* Helps with the now rare enrollment calibration errors we get
  and also with fingerprint enrollment after enrolling a fingerprint
  in DSU (without this it constantly fails with calibration error after that)

[Linux4: Pass 1 as parameter and unconditionally call it]

Change-Id: Idde4a4b06efc279d227ab2e3b4056ed8855dbf8f

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

index 2f0d1e3aec60b8e426e8cd943356e3e63a2f089e..b83a27fdd191d9b16a0a0b7a7d7421aff1ee1591 100644 (file)
@@ -48,6 +48,10 @@ ifeq ($(TARGET_SEC_FP_HAS_FINGERPRINT_GESTURES),true)
     LOCAL_CFLAGS += -DHAS_FINGERPRINT_GESTURES
 endif
 
+ifeq ($(TARGET_SEC_FP_REQUEST_FORCE_CALIBRATE),true)
+    LOCAL_CFLAGS += -DREQUEST_FORCE_CALIBRATE
+endif
+
 LOCAL_MODULE := android.hardware.biometrics.fingerprint@2.3-service.samsung
 LOCAL_INIT_RC := android.hardware.biometrics.fingerprint@2.3-service.samsung.rc
 LOCAL_VINTF_FRAGMENTS := android.hardware.biometrics.fingerprint@2.3-service.samsung.xml
index 256a36bd5435aa03294c27ac7639640763c13fe4..1d82b13f36220d344eceeab7574bc5d173dd2425 100644 (file)
@@ -219,6 +219,10 @@ Return<RequestStatus> BiometricsFingerprint::enroll(const hidl_array<uint8_t, 69
                                                     uint32_t gid, uint32_t timeoutSec) {
     const hw_auth_token_t* authToken = reinterpret_cast<const hw_auth_token_t*>(hat.data());
 
+#ifdef REQUEST_FORCE_CALIBRATE
+    request(SEM_REQUEST_FORCE_CBGE, 1);
+#endif
+
     return ErrorFilter(ss_fingerprint_enroll(authToken, gid, timeoutSec));
 }