Add debug property to enable/disable ANGLE
Due to b/118375731 we suspect that loading & unloading the feature
library is causing issues with spurious segfaults or other errors
when starting other apps. Disable use of feature library by default
until issue is resolved.
Bug: 118375731
Test: manual: adb shell setprop debug.angle.enable 1
Verify that feature library is loaded
adb shell setprop debug.angle.enable 0
Verify that feature library is not loaded
Change-Id: I80528acfe5138420085d24c4e7a3fc4e74903b88
diff --git a/opengl/libs/EGL/Loader.cpp b/opengl/libs/EGL/Loader.cpp
index 6f792ec..a7fea33 100644
--- a/opengl/libs/EGL/Loader.cpp
+++ b/opengl/libs/EGL/Loader.cpp
@@ -549,7 +549,14 @@
char model[PROPERTY_VALUE_MAX];
property_get("ro.product.manufacturer", manufacturer, "UNSET");
property_get("ro.product.model", model, "UNSET");
- so = load_angle_from_namespace("feature_support", ns);
+
+ // Check if ANGLE is enabled. Workaround for b/118375731
+ // We suspect that loading & unloading a library somehow corrupts
+ // the process.
+ property_get("debug.angle.enable", prop, "0");
+ if (atoi(prop)) {
+ so = load_angle_from_namespace("feature_support", ns);
+ }
if (so) {
ALOGV("Temporarily loaded ANGLE's opt-in/out logic from namespace");
bool use_version0_API = false;