sm6150-common: fingerprint: Allow loading FOD modules

Change-Id: I2ccef59698a570dcb35c331dd7994fb7f7af68f0
This commit is contained in:
Bruno Martins 2020-05-17 22:13:56 +01:00 committed by Arian
parent 9f781f1bdf
commit d1dd0a2214
No known key found for this signature in database
GPG Key ID: 48029380598CE3B9

View File

@ -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;
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;
}
fp_device = getDeviceForVendor("goodix");
if (fp_device == nullptr) {
ALOGE("Failed to load goodix fingerprint module");
} else {
return fp_device;
}