Make ANGLE loadable from system image.

Previously ANGLE was built as part of vendor partition, and hence when
it was the default OpenGL ES driver, the loader should use sphal
namespace to dlopen it. However, having ANGLE in vendor partition also
means Android OS relies on updates of the vendor partition to get ANGLE.
While in general ANGLE has an implicit dependency on the Vulkan driver
in the vendor partition, we should be able to update it outside of the
vendor parition. This patch changes the loading the ANGLE binaries with
the assumption that ANGLE binaries is part of the system image. This
will give Android OS the benefit to ship and update ANGLE independently
from vendor partition and hence shipping ANGLE is no longer blocked by
updating the vendor partition. This will also allow Android to have
minimal requirements on ANGLE.

Bug: b/293503000
Test: atest CtsAngleIntegrationHostTestCases -c
Change-Id: If32dd9ff8b023dc975930cb7bce7b003c10618e4
diff --git a/libs/graphicsenv/GraphicsEnv.cpp b/libs/graphicsenv/GraphicsEnv.cpp
index ed5d5c1..394a000 100644
--- a/libs/graphicsenv/GraphicsEnv.cpp
+++ b/libs/graphicsenv/GraphicsEnv.cpp
@@ -575,17 +575,23 @@
         return mAngleNamespace;
     }
 
-    if (mAnglePath.empty() && !mShouldUseSystemAngle) {
-        ALOGV("mAnglePath is empty and not using system ANGLE, abort creating ANGLE namespace");
+    // If ANGLE path is not set, it means ANGLE should not be used for this process;
+    // or if ANGLE path is set and set to use system ANGLE, then a namespace is not needed
+    // because:
+    //     1) if the default OpenGL ES driver is already ANGLE, then the loader will skip;
+    //     2) if the default OpenGL ES driver is native, then there's no symbol conflict;
+    //     3) if there's no OpenGL ES driver is preloaded, then there's no symbol conflict.
+    if (mAnglePath.empty() || mShouldUseSystemAngle) {
+        ALOGV("mAnglePath is empty or use system ANGLE, abort creating ANGLE namespace");
         return nullptr;
     }
 
     // Construct the search paths for system ANGLE.
     const char* const defaultLibraryPaths =
 #if defined(__LP64__)
-            "/vendor/lib64/egl:/system/lib64/egl";
+            "/vendor/lib64/egl:/system/lib64";
 #else
-            "/vendor/lib/egl:/system/lib/egl";
+            "/vendor/lib/egl:/system/lib";
 #endif
 
     // If the application process will run on top of system ANGLE, construct the namespace