ns.AddPermittedPath("/system/vendor/${LIB}", AsanPath::NONE);
if (ctx.IsApexBinaryConfig()) {
- ns.GetLink("vndk").AddSharedLib(
- Var("VNDK_SAMEPROCESS_LIBRARIES_VENDOR", ""));
- ns.GetLink(ctx.GetSystemNamespaceName())
- .AddSharedLib(Var("LLNDK_LIBRARIES_VENDOR", ""),
- // Add a link for libz.so which is llndk on
- // devices where VNDK is not enforced.
- "libz.so");
+ if (ctx.IsVndkAvailable()) {
+ ns.GetLink("vndk").AddSharedLib(
+ Var("VNDK_SAMEPROCESS_LIBRARIES_VENDOR", ""));
+ ns.GetLink(ctx.GetSystemNamespaceName())
+ .AddSharedLib(Var("LLNDK_LIBRARIES_VENDOR", ""));
+ }
+
+ // Add a link for libz.so which is llndk on devices where VNDK is not enforced.
+ ns.GetLink(ctx.GetSystemNamespaceName()).AddSharedLib("libz.so");
} else {
// Once in this namespace, access to libraries in /system/lib is restricted.
// Only libs listed here can be used. Order is important here as the
// namespace(s)
if (apex_info.name == "com.android.media.swcodec") {
namespaces.emplace_back(BuildSphalNamespace(ctx));
- namespaces.emplace_back(BuildVndkNamespace(ctx, VndkUserPartition::Vendor));
+ if (ctx.IsVndkAvailable()) {
+ namespaces.emplace_back(
+ BuildVndkNamespace(ctx, VndkUserPartition::Vendor));
+ }
}
return BuildSection(ctx, apex_info.name, std::move(namespaces), {});