Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save steven676/3338914 to your computer and use it in GitHub Desktop.
Save steven676/3338914 to your computer and use it in GitHub Desktop.
Look for libIMGegl.so in both /system/lib and /vendor/lib
--- a/opengl/libs/EGL/Loader.cpp 2012-08-13 02:51:04.000000000 -0700
+++ b/opengl/libs/EGL/Loader.cpp 2012-08-13 02:53:58.000000000 -0700
@@ -21,6 +21,7 @@
#include <errno.h>
#include <dlfcn.h>
#include <limits.h>
+#include <unistd.h>
#include <cutils/log.h>
#include <cutils/properties.h>
@@ -315,7 +315,13 @@ void *Loader::load_driver(const char* ki
*/
const char *cmdline = getProcessCmdline();
if (strstr(cmdline, "systemui")) {
- void *imgegl = dlopen("/system/lib/libIMGegl.so", RTLD_LAZY);
+ char *imgegl_path;
+ if (access("/vendor/lib/libIMGegl.so", F_OK) == 0) {
+ imgegl_path = "/vendor/lib/libIMGegl.so";
+ } else {
+ imgegl_path = "/system/lib/libIMGegl.so";
+ }
+ void *imgegl = dlopen(imgegl_path, RTLD_LAZY);
if (imgegl) {
unsigned int *PVRDefaultPBS =
(unsigned int *)dlsym(imgegl, "PVRDefaultPBS");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment