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

Commit e1e4ac74 authored by Jiyong Park's avatar Jiyong Park Committed by android-build-merger
Browse files

Merge "Don't fail if default namespace isn't found" am: 873d867e am: 5199628d am: a3f3c083

am: 4bd6099c

Change-Id: Ib665883b81212c5413b5770a5f6c0ebb91366c71
parents edd78eb8 4bd6099c
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(