Use dlsym on correct object
Previous CL missed changing dlsym references to new object
(cnx->featureSo) instead of just so.
Test: manual: inspect logcat to verify that rules are being processed
Bug: 80239516
Change-Id: I871d20578d54ee41b1832a64751b59bd90202aa3
diff --git a/opengl/libs/EGL/Loader.cpp b/opengl/libs/EGL/Loader.cpp
index 3d1eb14..a150db1 100644
--- a/opengl/libs/EGL/Loader.cpp
+++ b/opengl/libs/EGL/Loader.cpp
@@ -539,7 +539,6 @@
if (strcmp(kind, "EGL") != 0 && strcmp(kind, "GLESv2") != 0 && strcmp(kind, "GLESv1_CM") != 0)
return nullptr;
- void* so = nullptr;
std::string name;
char prop[PROPERTY_VALUE_MAX];
@@ -573,7 +572,7 @@
bool use_version0_API = false;
bool use_version1_API = false;
fpANGLEGetUtilityAPI ANGLEGetUtilityAPI =
- (fpANGLEGetUtilityAPI)dlsym(so, "ANGLEGetUtilityAPI");
+ (fpANGLEGetUtilityAPI)dlsym(cnx->featureSo, "ANGLEGetUtilityAPI");
if (ANGLEGetUtilityAPI) {
unsigned int versionToUse = 1;
if ((ANGLEGetUtilityAPI)(&versionToUse)) {
@@ -585,12 +584,13 @@
}
} else {
use_version0_API = true;
+ ALOGV("Cannot find ANGLEGetUtilityAPI in library");
}
if (use_version1_API) {
// Use the new version 1 API to determine if the
// application should use the ANGLE or the native driver.
fpAndroidUseANGLEForApplication AndroidUseANGLEForApplication =
- (fpAndroidUseANGLEForApplication)dlsym(so, "AndroidUseANGLEForApplication");
+ (fpAndroidUseANGLEForApplication)dlsym(cnx->featureSo, "AndroidUseANGLEForApplication");
if (AndroidUseANGLEForApplication) {
use_angle = (AndroidUseANGLEForApplication)(rules_fd, rules_offset,
rules_length, app_name_str.c_str(),
@@ -602,7 +602,7 @@
// Use the old version 0 API to determine if the
// application should use the ANGLE or the native driver.
fpANGLEUseForApplication ANGLEUseForApplication =
- (fpANGLEUseForApplication)dlsym(so, "ANGLEUseForApplication");
+ (fpANGLEUseForApplication)dlsym(cnx->featureSo, "ANGLEUseForApplication");
if (ANGLEUseForApplication) {
ANGLEPreference app_preference =
getAnglePref(android::GraphicsEnv::getInstance().getAngleAppPref());
@@ -621,6 +621,7 @@
}
cnx->angleDecided = true;
}
+ void* so = nullptr;
if (use_angle) {
so = load_angle_from_namespace(kind, ns);
}