Bug 716825 - Avoid loading system libraries with their full path. r=bjacob,r=gal,r=blassey

This commit is contained in:
Mike Hommey 2012-01-13 07:23:02 +01:00
parent a620faaa8d
commit 62c12f3946
7 changed files with 14 additions and 14 deletions

View File

@ -166,7 +166,7 @@ static bool init() {
if (gSurfaceFunctions.initialized)
return true;
void* handle = dlopen("/system/lib/libsurfaceflinger_client.so", RTLD_LAZY);
void* handle = dlopen("libsurfaceflinger_client.so", RTLD_LAZY);
if (!handle) {
LOG("Failed to open libsurfaceflinger_client.so");
@ -176,7 +176,7 @@ static bool init() {
gSurfaceFunctions.lock = (int (*)(void*, SurfaceInfo*, void*))dlsym(handle, "_ZN7android7Surface4lockEPNS0_11SurfaceInfoEPNS_6RegionEb");
gSurfaceFunctions.unlockAndPost = (int (*)(void*))dlsym(handle, "_ZN7android7Surface13unlockAndPostEv");
handle = dlopen("/system/lib/libui.so", RTLD_LAZY);
handle = dlopen("libui.so", RTLD_LAZY);
if (!handle) {
LOG("Failed to open libui.so");
return false;

View File

@ -4,7 +4,7 @@
"use strict";
let libcutils = (function () {
let library = ctypes.open("/system/lib/libcutils.so");
let library = ctypes.open("libcutils.so");
return {
property_get: library.declare("property_get", ctypes.default_abi, ctypes.int, ctypes.char.ptr, ctypes.char.ptr, ctypes.char.ptr),

View File

@ -4,7 +4,7 @@
"use strict";
let libhardware_legacy = (function () {
let library = ctypes.open("/system/lib/libhardware_legacy.so");
let library = ctypes.open("libhardware_legacy.so");
return {
// Load wifi driver, 0 on success, < 0 on failure.

View File

@ -4,7 +4,7 @@
"use strict";
let libnetutils = (function () {
let library = ctypes.open("/system/lib/libnetutils.so");
let library = ctypes.open("libnetutils.so");
return {
ifc_enable: library.declare("ifc_enable", ctypes.default_abi, ctypes.int, ctypes.char.ptr),

View File

@ -69,11 +69,11 @@
#include "AndroidBridge.h"
#endif
#include <android/log.h>
#define EGL_LIB "/system/lib/libEGL.so"
#define GLES2_LIB "/system/lib/libGLESv2.so"
#define EGL_LIB "libEGL.so"
#define GLES2_LIB "libGLESv2.so"
#else
#define EGL_LIB "/usr/lib/libEGL.so"
#define GLES2_LIB "/usr/lib/libGLESv2.so"
#define EGL_LIB "libEGL.so.1"
#define GLES2_LIB "libGLESv2.so.2"
#endif
typedef void *EGLNativeDisplayType;

View File

@ -1055,7 +1055,7 @@ AndroidBridge::OpenGraphicsLibraries()
mHasNativeWindowAccess = false;
mHasNativeBitmapAccess = false;
void *handle = dlopen("/system/lib/libjnigraphics.so", RTLD_LAZY | RTLD_LOCAL);
void *handle = dlopen("libjnigraphics.so", RTLD_LAZY | RTLD_LOCAL);
if (handle) {
AndroidBitmap_getInfo = (int (*)(JNIEnv *, jobject, void *))dlsym(handle, "AndroidBitmap_getInfo");
AndroidBitmap_lockPixels = (int (*)(JNIEnv *, jobject, void **))dlsym(handle, "AndroidBitmap_lockPixels");
@ -1068,7 +1068,7 @@ AndroidBridge::OpenGraphicsLibraries()
// Try to dlopen libandroid.so for and native window access on
// Android 2.3+ (API level 9)
handle = dlopen("/system/lib/libandroid.so", RTLD_LAZY | RTLD_LOCAL);
handle = dlopen("libandroid.so", RTLD_LAZY | RTLD_LOCAL);
if (handle) {
ANativeWindow_fromSurface = (void* (*)(JNIEnv*, jobject))dlsym(handle, "ANativeWindow_fromSurface");
ANativeWindow_release = (void (*)(void*))dlsym(handle, "ANativeWindow_release");

View File

@ -62,9 +62,9 @@ typedef gfxASurface::gfxImageFormat gfxImageFormat;
#define EGL_NO_CONTEXT (EGLContext)0
#define EGL_DEFAULT_DISPLAY (void*)0
#define ANDROID_LIBUI_PATH "/system/lib/libui.so"
#define ANDROID_GLES_PATH "/system/lib/libGLESv2.so"
#define ANDROID_EGL_PATH "/system/lib/libEGL.so"
#define ANDROID_LIBUI_PATH "libui.so"
#define ANDROID_GLES_PATH "libGLESv2.so"
#define ANDROID_EGL_PATH "libEGL.so"
// Really I have no idea, but this should be big enough
#define GRAPHIC_BUFFER_SIZE 1024