diff options
author | 2024-08-20 21:33:19 +0000 | |
---|---|---|
committer | 2024-08-20 21:33:19 +0000 | |
commit | 5245b8052806c20930af73e6b55353c516db196f (patch) | |
tree | 188d52b5d05bbf4046a4bcf28adaf41a1b03d5a9 | |
parent | 814c887fca85e05fd37224ff53fe1321da9ec0aa (diff) | |
parent | 90174054eafd9f6ddb05ae668fc5802450711718 (diff) |
Merge "Load UGD dependencies from SPHAL on non-VNDK devices" into main am: 90174054ea
Original change: https://android-review.googlesource.com/c/platform/frameworks/native/+/3220824
Change-Id: Iad92340fcb878e1523258acc140860cfa01b22a5
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
-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; |