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

Commit 5199628d 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

Change-Id: If62e74feb590aeed6a1180a5161b96ffa5a3c4ca
parents 8836527a 873d867e
Loading
Loading
Loading
Loading
+11 −3
Original line number Diff line number Diff line
@@ -69,10 +69,18 @@ Result<NativeLoaderNamespace> NativeLoaderNamespace::GetExportedNamespace(const
// "default" always exists.
Result<NativeLoaderNamespace> NativeLoaderNamespace::GetPlatformNamespace(bool is_bridged) {
  auto ns = GetExportedNamespace(kPlatformNamespaceName, is_bridged);
  if (!ns) {
  if (ns) return ns;
  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(