Fix the wrong lib path for 32 bit system am: e88430b374

Original change: https://android-review.googlesource.com/c/platform/hardware/st/secure_element/+/2829631

Change-Id: Ib8e24e2f12c0249dca3816f452d5002b442428b3
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
diff --git a/1.0/Android.bp b/1.0/Android.bp
index 297b277..720e735 100644
--- a/1.0/Android.bp
+++ b/1.0/Android.bp
@@ -28,4 +28,8 @@
         "liblog",
         "libutils",
     ],
+
+    arch: {
+        arm: { cflags: ["-DST_LIB_32"] },
+    }
 }
diff --git a/1.0/SecureElement.cpp b/1.0/SecureElement.cpp
index 7a71738..1501b9d 100644
--- a/1.0/SecureElement.cpp
+++ b/1.0/SecureElement.cpp
@@ -66,7 +66,11 @@
   }
 
   // Ignore this dlopen if you don't have libstpreprocess.so
+#if defined(ST_LIB_32)
+  void* stdll = dlopen("/vendor/lib/libstpreprocess.so", RTLD_NOW);
+#else
   void* stdll = dlopen("/vendor/lib64/libstpreprocess.so", RTLD_NOW);
+#endif
   if (stdll) {
     STAram_init fn_init = (STAram_init)dlsym(stdll, "STAram_init");
     if (fn_init) {
diff --git a/1.0/StEseService.cpp b/1.0/StEseService.cpp
index d6628e1..799d3eb 100644
--- a/1.0/StEseService.cpp
+++ b/1.0/StEseService.cpp
@@ -38,7 +38,11 @@
   ALOGD("Secure Element HAL Service 1.0 is starting.");
 
   // Ignore this dlopen it doesn't needed.
+#if defined(ST_LIB_32)
+  void* stdll = dlopen("/vendor/lib/libstpreprocess.so", RTLD_NOW);
+#else
   void* stdll = dlopen("/vendor/lib64/libstpreprocess.so", RTLD_NOW);
+#endif
   if (stdll) {
     STEsePreProcess fn = (STEsePreProcess)dlsym(stdll, "pre_process");
     if (fn) {
diff --git a/1.2/Android.bp b/1.2/Android.bp
index 8a9b7f8..154b2a3 100644
--- a/1.2/Android.bp
+++ b/1.2/Android.bp
@@ -44,4 +44,8 @@
         "liblog",
         "libutils",
     ],
+
+    arch: {
+        arm: { cflags: ["-DST_LIB_32"] },
+    }
 }
diff --git a/1.2/SecureElement.cpp b/1.2/SecureElement.cpp
index 222f41e..d817f43 100644
--- a/1.2/SecureElement.cpp
+++ b/1.2/SecureElement.cpp
@@ -24,7 +24,11 @@
 #include <stdlib.h>
 #include <string.h>
 
+#if defined(ST_LIB_32)
+#define VENDOR_LIB_PATH "/vendor/lib/"
+#else
 #define VENDOR_LIB_PATH "/vendor/lib64/"
+#endif
 #define VENDOR_LIB_EXT ".so"
 typedef int (*STEseReset)(void);