summaryrefslogtreecommitdiff
path: root/opengl
diff options
context:
space:
mode:
authorPeiyong Lin <lpy@google.com>2023-11-03 04:24:57 +0000
committerPeiyong Lin <lpy@google.com>2023-11-03 04:24:57 +0000
commit6b2b28f4afa9d74266442e5fda35ae9c062e3f18 (patch)
tree1dcd56b1666500d0267d79821579b3bc75d6cbb4 /opengl
parent50adab945ac11a190dc6d04f585f7461f8d3185b (diff)
downloadnative-6b2b28f4afa9d74266442e5fda35ae9c062e3f18.tar.gz
Do not use default namespace to load ANGLE when in vendor partition.
Previously the loader was changed to always assume ANGLE is in system partition, but this is not true until the flag is enabled. Bug: b/309001559 Test: avd boot Change-Id: Ia973bd2cc9e3aff3693e28784c61fb8bf61adaf5
Diffstat (limited to 'opengl')
-rw-r--r--opengl/libs/EGL/Loader.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/opengl/libs/EGL/Loader.cpp b/opengl/libs/EGL/Loader.cpp
index e0ad6d9d9d..0e685bc15b 100644
--- a/opengl/libs/EGL/Loader.cpp
+++ b/opengl/libs/EGL/Loader.cpp
@@ -67,6 +67,7 @@ static const char* PERSIST_DRIVER_SUFFIX_PROPERTY = "persist.graphics.egl";
static const char* RO_DRIVER_SUFFIX_PROPERTY = "ro.hardware.egl";
static const char* RO_BOARD_PLATFORM_PROPERTY = "ro.board.platform";
static const char* ANGLE_SUFFIX_VALUE = "angle";
+static const char* VENDOR_ANGLE_BUILD = "ro.gfx.angle.supported";
static const char* HAL_SUBNAME_KEY_PROPERTIES[3] = {
PERSIST_DRIVER_SUFFIX_PROPERTY,
@@ -493,8 +494,10 @@ static void* load_system_driver(const char* kind, const char* suffix, const bool
void* dso = nullptr;
+ const bool AngleInVendor = property_get_bool(VENDOR_ANGLE_BUILD, false);
+ const bool isSuffixAngle = suffix != nullptr && strcmp(suffix, ANGLE_SUFFIX_VALUE) == 0;
// Only use sphal namespace when system ANGLE binaries are not the default drivers.
- const bool useSphalNamespace = suffix != nullptr && strcmp(suffix, ANGLE_SUFFIX_VALUE) != 0;
+ const bool useSphalNamespace = !isSuffixAngle || AngleInVendor;
const std::string absolutePath =
findLibrary(libraryName, useSphalNamespace ? VENDOR_LIB_EGL_DIR : SYSTEM_LIB_PATH,