namespace linkerconfig {
namespace contents {
Namespace BuildRsNamespace([[maybe_unused]] const Context& ctx) {
- Namespace ns("rs", /*is_isolated=*/true, /*is_visible=*/true);
+ Namespace ns(
+ "rs", /*is_isolated=*/!ctx.IsUnrestrictedSection(), /*is_visible=*/true);
ns.AddSearchPath("/odm/${LIB}/vndk-sp", AsanPath::WITH_DATA_ASAN);
ns.AddSearchPath("/vendor/${LIB}/vndk-sp", AsanPath::WITH_DATA_ASAN);
Namespace BuildSphalNamespace([[maybe_unused]] const Context& ctx) {
// Visible to allow use with android_dlopen_ext, and with
// android_link_namespaces in libnativeloader.
- Namespace ns("sphal", /*is_isolated=*/true, /*is_visible=*/true);
+ Namespace ns("sphal",
+ /*is_isolated=*/!ctx.IsUnrestrictedSection(),
+ /*is_visible=*/true);
ns.AddSearchPath("/odm/${LIB}", AsanPath::WITH_DATA_ASAN);
ns.AddSearchPath("/vendor/${LIB}", AsanPath::WITH_DATA_ASAN);
ns.AddSearchPath("/vendor/${LIB}/hw", AsanPath::NONE);
// Only libs listed here can be used. Order is important here as the
// namespaces are tried in this order. rs should be before vndk because both
// are capable of loading libRS_internal.so
- if (ctx.IsSystemSection()) {
+ if (ctx.IsSystemSection() || ctx.IsUnrestrictedSection()) {
ns.GetLink("rs").AddSharedLib("libRS_internal.so");
}
ns.GetLink(ctx.GetSystemNamespaceName())
// in libnativeloader. Otherwise it isn't isolated, so visibility doesn't
// matter.
Namespace ns(name,
- /*is_isolated=*/is_system_or_unrestricted_section,
+ /*is_isolated=*/ctx.IsSystemSection() || ctx.IsApexBinaryConfig(),
/*is_visible=*/is_system_or_unrestricted_section);
std::vector<std::string> lib_paths;
if (ctx.IsVndkAvailable()) {
namespaces.emplace_back(BuildSphalNamespace(ctx));
namespaces.emplace_back(BuildVndkNamespace(ctx, VndkUserPartition::Vendor));
+ namespaces.emplace_back(BuildRsNamespace(ctx));
}
return BuildSection(ctx,