diff options
author | Andrés Domínguez <andresdju@gmail.com> | 2019-08-15 21:04:32 +0200 |
---|---|---|
committer | Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org> | 2020-01-09 00:31:42 +0100 |
commit | 0c0a80dd98f8a2d463483ee501c38c8821d67972 (patch) | |
tree | 08718686abb776f08998c0d145f0a2164e892701 /opengl/libs/EGL | |
parent | 7a92f7cb588bcf2a214a6e0a2e4a641ed842eb95 (diff) | |
download | frameworks_native-0c0a80dd98f8a2d463483ee501c38c8821d67972.tar.gz frameworks_native-0c0a80dd98f8a2d463483ee501c38c8821d67972.tar.bz2 frameworks_native-0c0a80dd98f8a2d463483ee501c38c8821d67972.zip |
Change symlinks to files and static pathsreplicant-6.0-0004-rc1
GNUtoo: tiny whitespace fixes
Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
Diffstat (limited to 'opengl/libs/EGL')
-rw-r--r-- | opengl/libs/EGL/Loader.cpp | 39 |
1 files changed, 27 insertions, 12 deletions
diff --git a/opengl/libs/EGL/Loader.cpp b/opengl/libs/EGL/Loader.cpp index b90c49166..ea1621c67 100644 --- a/opengl/libs/EGL/Loader.cpp +++ b/opengl/libs/EGL/Loader.cpp @@ -22,6 +22,7 @@ #include <dlfcn.h> #include <limits.h> #include <dirent.h> +#include <unistd.h> #include <cutils/log.h> #include <cutils/properties.h> @@ -142,6 +143,9 @@ static char const * getProcessCmdline() { * where %s is determined at runtime to be GLES, EGL, GLESv1_CM, or GLESv2. */ static const char* getOverridePath(void) { + + ALOGD("UID:%d EUID:%d", getuid(), geteuid()); + // only really useful if ro.zygote.disable_gl_preload is enabled // otherwise overrides only happen once, to zygote if (!property_get_bool("ro.zygote.disable_gl_preload", 0)) { @@ -152,29 +156,40 @@ static const char* getOverridePath(void) { String8 data_override_path("/data/data/"); data_override_path.appendFormat("%s", getProcessCmdline()); - data_override_path.appendFormat("%s", "/os_override/libGLES_impl.so"); + data_override_path.appendFormat("%s", "/libGLES_mesa"); - ALOGD("checking %s for override...", - data_override_path.string()); - if (!access( data_override_path.string(), R_OK ) ) { + if (!access( data_override_path.string(), F_OK ) ) { ALOGD("override found: %s", data_override_path.string()); - return data_override_path.string(); + return "/system/lib/egl/libGLES_mesa.so"; } - String8 system_override_path("/system/etc/os_override/"); + data_override_path.setTo("/data/data/"); + data_override_path.appendFormat("%s", getProcessCmdline()); + data_override_path.appendFormat("%s", "/libGLES_android"); + + if (!access( data_override_path.string(), F_OK ) ) { + ALOGD("override found: %s", data_override_path.string()); + return "/system/lib/egl/libGLES_android.so"; + } + + String8 system_override_path("/system/etc/libGLES_mesa/"); system_override_path.appendFormat("%s", getProcessCmdline()); - system_override_path.appendFormat("%s", "/libGLES_impl.so"); - ALOGD("checking %s for override...", - system_override_path.string()); + if (!access( system_override_path.string(), F_OK ) ) { + ALOGD("override found: %s", system_override_path.string()); + return "/system/lib/egl/libGLES_mesa.so"; + } + + system_override_path.setTo("/system/etc/libGLES_android/"); + system_override_path.appendFormat("%s", getProcessCmdline()); - if (!access( system_override_path.string(), R_OK ) ) { + if (!access( system_override_path.string(), F_OK ) ) { ALOGD("override found: %s", system_override_path.string()); - return system_override_path.string(); + return "/system/lib/egl/libGLES_android.so"; } - ALOGD("no override found"); + ALOGD("no EGL override found"); return 0; } |