Merge "mediacas: make it also work on 64bit only guest" into sc-dev am: fa37ec0a81 am: d500b7785f
Original change: https://googleplex-android-review.googlesource.com/c/platform/hardware/interfaces/+/13444417
MUST ONLY BE SUBMITTED BY AUTOMERGER
Change-Id: Ief132de9d0531f063baa1161a430c174da591ff0
diff --git a/cas/1.0/default/Android.bp b/cas/1.0/default/Android.bp
index f9977ff..70f4371 100644
--- a/cas/1.0/default/Android.bp
+++ b/cas/1.0/default/Android.bp
@@ -12,7 +12,7 @@
"TypeConvert.cpp",
],
- compile_multilib: "32",
+ compile_multilib: "prefer32",
shared_libs: [
"android.hardware.cas@1.0",
diff --git a/cas/1.0/default/FactoryLoader.h b/cas/1.0/default/FactoryLoader.h
index 18c2186..45e515a 100644
--- a/cas/1.0/default/FactoryLoader.h
+++ b/cas/1.0/default/FactoryLoader.h
@@ -92,7 +92,12 @@
}
// no luck, have to search
+#ifdef __LP64__
+ String8 dirPath("/vendor/lib64/mediacas");
+#else
String8 dirPath("/vendor/lib/mediacas");
+#endif
+
DIR* pDir = opendir(dirPath.string());
if (pDir == NULL) {
@@ -127,7 +132,12 @@
results->clear();
+#ifdef __LP64__
+ String8 dirPath("/vendor/lib64/mediacas");
+#else
String8 dirPath("/vendor/lib/mediacas");
+#endif
+
DIR* pDir = opendir(dirPath.string());
if (pDir == NULL) {
diff --git a/cas/1.1/default/Android.bp b/cas/1.1/default/Android.bp
index 66a1eb8..8e1f207 100644
--- a/cas/1.1/default/Android.bp
+++ b/cas/1.1/default/Android.bp
@@ -12,7 +12,7 @@
"TypeConvert.cpp",
],
- compile_multilib: "32",
+ compile_multilib: "prefer32",
shared_libs: [
"android.hardware.cas@1.0",
diff --git a/cas/1.1/default/FactoryLoader.h b/cas/1.1/default/FactoryLoader.h
index c4a48e2..121f90c 100644
--- a/cas/1.1/default/FactoryLoader.h
+++ b/cas/1.1/default/FactoryLoader.h
@@ -85,7 +85,11 @@
}
// no luck, have to search
+#ifdef __LP64__
+ String8 dirPath("/vendor/lib64/mediacas");
+#else
String8 dirPath("/vendor/lib/mediacas");
+#endif
DIR* pDir = opendir(dirPath.string());
if (pDir == NULL) {
@@ -118,7 +122,11 @@
results->clear();
+#ifdef __LP64__
+ String8 dirPath("/vendor/lib64/mediacas");
+#else
String8 dirPath("/vendor/lib/mediacas");
+#endif
DIR* pDir = opendir(dirPath.string());
if (pDir == NULL) {
diff --git a/cas/1.2/default/Android.bp b/cas/1.2/default/Android.bp
index 9e53148..d855e85 100644
--- a/cas/1.2/default/Android.bp
+++ b/cas/1.2/default/Android.bp
@@ -12,7 +12,7 @@
"TypeConvert.cpp",
],
- compile_multilib: "32",
+ compile_multilib: "prefer32",
shared_libs: [
"android.hardware.cas@1.0",
diff --git a/cas/1.2/default/FactoryLoader.h b/cas/1.2/default/FactoryLoader.h
index 7403f86..a374b31 100644
--- a/cas/1.2/default/FactoryLoader.h
+++ b/cas/1.2/default/FactoryLoader.h
@@ -85,7 +85,11 @@
}
// no luck, have to search
+#ifdef __LP64__
+ String8 dirPath("/vendor/lib64/mediacas");
+#else
String8 dirPath("/vendor/lib/mediacas");
+#endif
DIR* pDir = opendir(dirPath.string());
if (pDir == NULL) {
@@ -118,7 +122,11 @@
results->clear();
+#ifdef __LP64__
+ String8 dirPath("/vendor/lib64/mediacas");
+#else
String8 dirPath("/vendor/lib/mediacas");
+#endif
DIR* pDir = opendir(dirPath.string());
if (pDir == NULL) {