Pass more ANGLE info from runtime

In order to facilitate ANGLE selection logic in the backend, we need to
start sending more information from GraphicsEnvironment.  This includes
the application name, whether the developer opted in, and the list can
be expanded.  We also have to send the ANGLE namespace unconditionally
in case the application opts in programmatically.

Bug: 80239516
Test: Manual build, booted clean, ensured developer opt-in still works.
Change-Id: I3b8f99942999de6a3188d2e61355dcd244f9191e
(cherry picked from commit 6a88da6463f019ad1e3aea184e6ac6f5264fae50)
diff --git a/opengl/libs/EGL/Loader.cpp b/opengl/libs/EGL/Loader.cpp
index 2e01965..531bb20 100644
--- a/opengl/libs/EGL/Loader.cpp
+++ b/opengl/libs/EGL/Loader.cpp
@@ -475,7 +475,7 @@
     return nullptr;
 }
 
-static void* load_angle(const char* kind, android_namespace_t* ns, egl_connection_t* cnx) {
+static void* load_angle(const char* kind, egl_connection_t* cnx) {
     // Only attempt to load ANGLE libs
     if (strcmp(kind, "EGL") != 0 && strcmp(kind, "GLESv2") != 0 && strcmp(kind, "GLESv1_CM") != 0)
         return nullptr;
@@ -483,11 +483,20 @@
     void* so = nullptr;
     std::string name;
 
+    android_namespace_t* ns = android_getAngleNamespace();
+    const char* app_name = android_getAngleAppName();
+    bool developer_opt_in = android_getAngleDeveloperOptIn();
+
     if (ns) {
-        so = load_angle_from_namespace(kind, ns);
+        // If we got a namespce for ANGLE, check any other conditions
+        // before loading from it.
+        if (developer_opt_in) {
+            so = load_angle_from_namespace(kind, ns);
+        }
     }
 
     if (so) {
+        ALOGD("Loaded ANGLE libraries for %s", app_name ? app_name : "nullptr");
         cnx->useAngle = true;
         // Find and load vendor libEGL for ANGLE
         if (!cnx->vendorEGL) {
@@ -530,11 +539,10 @@
     ATRACE_CALL();
 
     void* dso = nullptr;
-    android_namespace_t* ns = android_getAngleNamespace();
-    dso = load_angle(kind, ns, cnx);
+    dso = load_angle(kind, cnx);
 #ifndef __ANDROID_VNDK__
     if (!dso) {
-        ns = android_getDriverNamespace();
+        android_namespace_t* ns = android_getDriverNamespace();
         if (ns) {
             dso = load_updated_driver(kind, ns);
         }