goldfish-opengl: fix -gpu guest compatibility issue
For older apis, the gralloc.default.so is still used.
so, check gralloc.goldfish.default.so first and
then check gralloc.default.so second.
Change-Id: I474e0cd869d4cdd2c5e7e9d70860581b62a671bd
Merged-In: I474e0cd869d4cdd2c5e7e9d70860581b62a671bd
diff --git a/system/gralloc/gralloc.cpp b/system/gralloc/gralloc.cpp
index 590be0c..3a1d2dd 100644
--- a/system/gralloc/gralloc.cpp
+++ b/system/gralloc/gralloc.cpp
@@ -1490,9 +1490,13 @@
#if __LP64__
static const char kGrallocDefaultSystemPath[] = "/system/lib64/hw/gralloc.goldfish.default.so";
static const char kGrallocDefaultVendorPath[] = "/vendor/lib64/hw/gralloc.goldfish.default.so";
+static const char kGrallocDefaultSystemPathPreP[] = "/system/lib64/hw/gralloc.default.so";
+static const char kGrallocDefaultVendorPathPreP[] = "/vendor/lib64/hw/gralloc.default.so";
#else
static const char kGrallocDefaultSystemPath[] = "/system/lib/hw/gralloc.goldfish.default.so";
static const char kGrallocDefaultVendorPath[] = "/vendor/lib/hw/gralloc.goldfish.default.so";
+static const char kGrallocDefaultSystemPathPreP[] = "/system/lib/hw/gralloc.default.so";
+static const char kGrallocDefaultVendorPathPreP[] = "/vendor/lib/hw/gralloc.default.so";
#endif
static void
@@ -1513,10 +1517,16 @@
kGrallocDefaultVendorPath);
module = dlopen(kGrallocDefaultVendorPath, RTLD_LAZY | RTLD_LOCAL);
if (!module) {
+ module = dlopen(kGrallocDefaultVendorPathPreP, RTLD_LAZY | RTLD_LOCAL);
+ }
+ if (!module) {
// vendor folder didn't work. try system
ALOGD("gralloc.default.so not found in /vendor. Trying %s...",
kGrallocDefaultSystemPath);
module = dlopen(kGrallocDefaultSystemPath, RTLD_LAZY | RTLD_LOCAL);
+ if (!module) {
+ module = dlopen(kGrallocDefaultSystemPathPreP, RTLD_LAZY | RTLD_LOCAL);
+ }
}
if (module != NULL) {