diff --git a/fingerprint/BiometricsFingerprint.cpp b/fingerprint/BiometricsFingerprint.cpp index 399a630..ff7d9a1 100644 --- a/fingerprint/BiometricsFingerprint.cpp +++ b/fingerprint/BiometricsFingerprint.cpp @@ -255,18 +255,13 @@ fingerprint_device_t* getDeviceForVendor(const char *class_name) { fingerprint_device_t* getFingerprintDevice() { fingerprint_device_t *fp_device; + std::string vendor_modules[] = { "fpc", "fpc_fod", "goodix", "goodix_fod" }; - fp_device = getDeviceForVendor("fpc"); - if (fp_device == nullptr) { - ALOGE("Failed to load fpc fingerprint module"); - } else { - return fp_device; - } - - fp_device = getDeviceForVendor("goodix"); - if (fp_device == nullptr) { - ALOGE("Failed to load goodix fingerprint module"); - } else { + for (const auto& vendor : vendor_modules) { + if ((fp_device = getDeviceForVendor(vendor.c_str())) == nullptr) { + ALOGE("Failed to load %s fingerprint module", vendor.c_str()); + continue; + } return fp_device; }