@@ -83,6 +83,55 @@ static constexpr const char* kNativeLibrariesSystemConfigPath[] =
8383
8484static const char * kLlndkLibrariesTxtPath = " /system/etc/llndk.libraries.txt" ;
8585
86+ // List of libraries that were previously available via VNDK-SP,
87+ // and are now available via SPHAL.
88+ // On modern devices that lack the VNDK APEX, the device no longer
89+ // contains a helpful list of these libraries on the filesystem as above.
90+ // See system/sepolicy/vendor/file_contexts
91+ static const char * kFormerlyVndkspLibrariesList =
92+ " android.hardware.common-V2-ndk.so:"
93+ " android.hardware.common.fmq-V1-ndk.so:"
94+ " android.hardware.graphics.allocator-V2-ndk.so:"
95+ " android.hardware.graphics.common-V5-ndk.so:"
96+ " android.hardware.graphics.common@1.0.so:"
97+ " android.hardware.graphics.common@1.1.so:"
98+ " android.hardware.graphics.common@1.2.so:"
99+ " android.hardware.graphics.composer3-V1-ndk.so:"
100+ " android.hardware.graphics.mapper@2.0.so:"
101+ " android.hardware.graphics.mapper@2.1.so:"
102+ " android.hardware.graphics.mapper@3.0.so:"
103+ " android.hardware.graphics.mapper@4.0.so:"
104+ " android.hardware.renderscript@1.0.so:"
105+ " android.hidl.memory.token@1.0.so:"
106+ " android.hidl.memory@1.0-impl.so:"
107+ " android.hidl.memory@1.0.so:"
108+ " android.hidl.safe_union@1.0.so:"
109+ " libRSCpuRef.so:"
110+ " libRSDriver.so:"
111+ " libRS_internal.so:"
112+ " libbacktrace.so:"
113+ " libbase.so:"
114+ " libbcinfo.so:"
115+ " libblas.so:"
116+ " libc++.so:"
117+ " libcompiler_rt.so:"
118+ " libcutils.so:"
119+ " libdmabufheap.so:"
120+ " libft2.so:"
121+ " libgralloctypes.so:"
122+ " libhardware.so:"
123+ " libhidlbase.so:"
124+ " libhidlmemory.so:"
125+ " libion.so:"
126+ " libjsoncpp.so:"
127+ " liblzma.so:"
128+ " libpng.so:"
129+ " libprocessgroup.so:"
130+ " libunwindstack.so:"
131+ " libutils.so:"
132+ " libutilscallstack.so:"
133+ " libz.so" ;
134+
86135static std::string vndkVersionStr () {
87136#ifdef __BIONIC__
88137 return base::GetProperty (" ro.vndk.version" , " " );
@@ -122,8 +171,12 @@ static bool readConfig(const std::string& configFile, std::vector<std::string>*
122171static const std::string getSystemNativeLibraries (NativeLibrary type) {
123172 std::string nativeLibrariesSystemConfig = " " ;
124173
125- if (!isVndkEnabled () && type == NativeLibrary::LLNDK) {
126- nativeLibrariesSystemConfig = kLlndkLibrariesTxtPath ;
174+ if (!isVndkEnabled ()) {
175+ if (type == NativeLibrary::VNDKSP) {
176+ return kFormerlyVndkspLibrariesList ;
177+ } else {
178+ nativeLibrariesSystemConfig = kLlndkLibrariesTxtPath ;
179+ }
127180 } else {
128181 nativeLibrariesSystemConfig = kNativeLibrariesSystemConfigPath [type];
129182 insertVndkVersionStr (&nativeLibrariesSystemConfig);
@@ -263,7 +316,7 @@ android_namespace_t* GraphicsEnv::getDriverNamespace() {
263316 ALOGI (" Driver path is setup via UPDATABLE_GFX_DRIVER: %s" , mDriverPath .c_str ());
264317 }
265318
266- auto vndkNamespace = android_get_exported_namespace (" vndk" );
319+ auto vndkNamespace = android_get_exported_namespace (isVndkEnabled () ? " vndk" : " sphal " );
267320 if (!vndkNamespace) {
268321 mDriverNamespace = nullptr ;
269322 return mDriverNamespace ;
@@ -616,7 +669,7 @@ android_namespace_t* GraphicsEnv::getAngleNamespace() {
616669 return mAngleNamespace ;
617670 }
618671
619- auto vndkNamespace = android_get_exported_namespace (" vndk" );
672+ auto vndkNamespace = android_get_exported_namespace (isVndkEnabled () ? " vndk" : " sphal " );
620673 if (!vndkNamespace) {
621674 mAngleNamespace = nullptr ;
622675 return mAngleNamespace ;
0 commit comments