Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 873d867e authored by Treehugger Robot's avatar Treehugger Robot Committed by Gerrit Code Review
Browse files

Merge "Don't fail if default namespace isn't found"

parents 6bac7cd9 c5e85bf9
Loading
Loading
Loading
Loading
+11 −3
Original line number Original line Diff line number Diff line
@@ -69,10 +69,18 @@ Result<NativeLoaderNamespace> NativeLoaderNamespace::GetExportedNamespace(const
// "default" always exists.
// "default" always exists.
Result<NativeLoaderNamespace> NativeLoaderNamespace::GetPlatformNamespace(bool is_bridged) {
Result<NativeLoaderNamespace> NativeLoaderNamespace::GetPlatformNamespace(bool is_bridged) {
  auto ns = GetExportedNamespace(kPlatformNamespaceName, is_bridged);
  auto ns = GetExportedNamespace(kPlatformNamespaceName, is_bridged);
  if (!ns) {
  if (ns) return ns;
  ns = GetExportedNamespace(kDefaultNamespaceName, is_bridged);
  ns = GetExportedNamespace(kDefaultNamespaceName, is_bridged);
  if (ns) return ns;

  // If nothing is found, return NativeLoaderNamespace constructed from nullptr.
  // nullptr also means default namespace to the linker.
  if (!is_bridged) {
    return NativeLoaderNamespace(kDefaultNamespaceName, static_cast<android_namespace_t*>(nullptr));
  } else {
    return NativeLoaderNamespace(kDefaultNamespaceName,
                                 static_cast<native_bridge_namespace_t*>(nullptr));
  }
  }
  return ns;
}
}


Result<NativeLoaderNamespace> NativeLoaderNamespace::Create(
Result<NativeLoaderNamespace> NativeLoaderNamespace::Create(