diff options
author | 2024-08-16 15:12:27 +1200 | |
---|---|---|
committer | 2024-08-16 03:57:05 +0000 | |
commit | 0cdac9a4ee3871dcd8edd1cefec2b47d34d46d86 (patch) | |
tree | 3521984f46aefcf7c75ffc7416d397638d827e77 | |
parent | 5a0ca631c5dde0a144cbe659835d0fad2918def8 (diff) |
Load UGD dependencies from SPHAL on non-VNDK devices
If there is no VNDK namespace (as on new devices), load the UGD
dependencies from the SPHAL namespace instead. Include a fixed
list of these libraries since such a device will not have the VNDK
APEX which used to provide the library list.
Bug: b/349287141
Flag: EXEMPT bugfix
Change-Id: Ic4451ef1197b4bd2111052505299409376756a00
-rw-r--r-- | libs/graphicsenv/GraphicsEnv.cpp | 61 |
1 files changed, 57 insertions, 4 deletions
diff --git a/libs/graphicsenv/GraphicsEnv.cpp b/libs/graphicsenv/GraphicsEnv.cpp index 52383acb34..4c3f4a6428 100644 --- a/libs/graphicsenv/GraphicsEnv.cpp +++ b/libs/graphicsenv/GraphicsEnv.cpp @@ -83,6 +83,55 @@ static constexpr const char* kNativeLibrariesSystemConfigPath[] = static const char* kLlndkLibrariesTxtPath = "/system/etc/llndk.libraries.txt"; +// List of libraries that were previously available via VNDK-SP, +// and are now available via SPHAL. +// On modern devices that lack the VNDK APEX, the device no longer +// contains a helpful list of these libraries on the filesystem as above. +// See system/sepolicy/vendor/file_contexts +static const char* kFormerlyVndkspLibrariesList = + "android.hardware.common-V2-ndk.so:" + "android.hardware.common.fmq-V1-ndk.so:" + "android.hardware.graphics.allocator-V2-ndk.so:" + "android.hardware.graphics.common-V5-ndk.so:" + "android.hardware.graphics.common@1.0.so:" + "android.hardware.graphics.common@1.1.so:" + "android.hardware.graphics.common@1.2.so:" + "android.hardware.graphics.composer3-V1-ndk.so:" + "android.hardware.graphics.mapper@2.0.so:" + "android.hardware.graphics.mapper@2.1.so:" + "android.hardware.graphics.mapper@3.0.so:" + "android.hardware.graphics.mapper@4.0.so:" + "android.hardware.renderscript@1.0.so:" + "android.hidl.memory.token@1.0.so:" + "android.hidl.memory@1.0-impl.so:" + "android.hidl.memory@1.0.so:" + "android.hidl.safe_union@1.0.so:" + "libRSCpuRef.so:" + "libRSDriver.so:" + "libRS_internal.so:" + "libbacktrace.so:" + "libbase.so:" + "libbcinfo.so:" + "libblas.so:" + "libc++.so:" + "libcompiler_rt.so:" + "libcutils.so:" + "libdmabufheap.so:" + "libft2.so:" + "libgralloctypes.so:" + "libhardware.so:" + "libhidlbase.so:" + "libhidlmemory.so:" + "libion.so:" + "libjsoncpp.so:" + "liblzma.so:" + "libpng.so:" + "libprocessgroup.so:" + "libunwindstack.so:" + "libutils.so:" + "libutilscallstack.so:" + "libz.so"; + static std::string vndkVersionStr() { #ifdef __BIONIC__ return base::GetProperty("ro.vndk.version", ""); @@ -122,8 +171,12 @@ static bool readConfig(const std::string& configFile, std::vector<std::string>* static const std::string getSystemNativeLibraries(NativeLibrary type) { std::string nativeLibrariesSystemConfig = ""; - if (!isVndkEnabled() && type == NativeLibrary::LLNDK) { - nativeLibrariesSystemConfig = kLlndkLibrariesTxtPath; + if (!isVndkEnabled()) { + if (type == NativeLibrary::VNDKSP) { + return kFormerlyVndkspLibrariesList; + } else { + nativeLibrariesSystemConfig = kLlndkLibrariesTxtPath; + } } else { nativeLibrariesSystemConfig = kNativeLibrariesSystemConfigPath[type]; insertVndkVersionStr(&nativeLibrariesSystemConfig); @@ -263,7 +316,7 @@ android_namespace_t* GraphicsEnv::getDriverNamespace() { ALOGI("Driver path is setup via UPDATABLE_GFX_DRIVER: %s", mDriverPath.c_str()); } - auto vndkNamespace = android_get_exported_namespace("vndk"); + auto vndkNamespace = android_get_exported_namespace(isVndkEnabled() ? "vndk" : "sphal"); if (!vndkNamespace) { mDriverNamespace = nullptr; return mDriverNamespace; @@ -631,7 +684,7 @@ android_namespace_t* GraphicsEnv::getAngleNamespace() { return mAngleNamespace; } - auto vndkNamespace = android_get_exported_namespace("vndk"); + auto vndkNamespace = android_get_exported_namespace(isVndkEnabled() ? "vndk" : "sphal"); if (!vndkNamespace) { mAngleNamespace = nullptr; return mAngleNamespace; |