From bc0f99a540d75e8f5051fffeea1f27bff11e1eb4 Mon Sep 17 00:00:00 2001 From: Steve Kondik Date: Wed, 6 Feb 2013 11:39:51 -0800 Subject: libnfc-nxp: Add alternate firmware path * Check in /system/lib for firmware as well, so we can be bug-for-bug compatible with OEMs. Change-Id: Iea350c3d0a58a1f6012c2a088f8ba6fed4b10365 --- src/phHal4Nfc.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/phHal4Nfc.c b/src/phHal4Nfc.c index b4c1d45..f40ed9b 100755 --- a/src/phHal4Nfc.c +++ b/src/phHal4Nfc.c @@ -307,6 +307,7 @@ phHal4Nfc_Configure_Layers( #include #define FW_PATH "/system/vendor/firmware/libpn544_fw.so" +#define FW_PATH_2 "/system/lib/libpn544_fw.so" const unsigned char *nxp_nfc_full_version = NULL; const unsigned char *nxp_nfc_fw = NULL; @@ -316,8 +317,11 @@ int dlopen_firmware() { void *handle = dlopen(FW_PATH, RTLD_NOW); if (handle == NULL) { - ALOGE("Could not open %s", FW_PATH); - return -1; + handle = dlopen(FW_PATH_2, RTLD_NOW); + if (handle == NULL) { + ALOGE("Could not open %s or %s", FW_PATH, FW_PATH_2); + return -1; + } } p = dlsym(handle, "nxp_nfc_full_version"); -- cgit v1.1