Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 1c59b6b3 authored by Peiyong Lin's avatar Peiyong Lin Committed by Automerger Merge Worker
Browse files

Merge "Do not use default namespace to load ANGLE when in vendor partition."...

Merge "Do not use default namespace to load ANGLE when in vendor partition." into main am: 1d1f7ac5 am: f2497656

Original change: https://android-review.googlesource.com/c/platform/frameworks/native/+/2815885



Change-Id: Ibdd814bfbed199ea4348e31f139d9f740e00028b
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents eaf5d4af f2497656
Loading
Loading
Loading
Loading
+4 −1
Original line number Original line Diff line number Diff line
@@ -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_DRIVER_SUFFIX_PROPERTY = "ro.hardware.egl";
static const char* RO_BOARD_PLATFORM_PROPERTY = "ro.board.platform";
static const char* RO_BOARD_PLATFORM_PROPERTY = "ro.board.platform";
static const char* ANGLE_SUFFIX_VALUE = "angle";
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] = {
static const char* HAL_SUBNAME_KEY_PROPERTIES[3] = {
        PERSIST_DRIVER_SUFFIX_PROPERTY,
        PERSIST_DRIVER_SUFFIX_PROPERTY,
@@ -493,8 +494,10 @@ static void* load_system_driver(const char* kind, const char* suffix, const bool


    void* dso = nullptr;
    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.
    // 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 =
    const std::string absolutePath =
            findLibrary(libraryName, useSphalNamespace ? VENDOR_LIB_EGL_DIR : SYSTEM_LIB_PATH,
            findLibrary(libraryName, useSphalNamespace ? VENDOR_LIB_EGL_DIR : SYSTEM_LIB_PATH,