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

Commit b870bbd6 authored by Dimitry Ivanov's avatar Dimitry Ivanov Committed by android-build-merger
Browse files

Merge "Return nullptr from FindNamespaceByClassLoader for NB-enabled apps."

am: c54c533c

Change-Id: If1801f74a0a55e3cb526f1f00566d119d14da92a
parents c406474c c54c533c
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -473,14 +473,14 @@ bool CloseNativeLibrary(void* handle, const bool needs_native_bridge) {
}

#if defined(__ANDROID__)
// native_bridge_namespaces are not supported for callers of this function.
// This function will return nullptr in the case when application is running
// on native bridge.
android_namespace_t* FindNamespaceByClassLoader(JNIEnv* env, jobject class_loader) {
  std::lock_guard<std::mutex> guard(g_namespaces_mutex);
  // native_bridge_namespaces are not supported for callers of this function.
  // At the moment this is libwebviewchromium_loader and vulkan.
  NativeLoaderNamespace ns;
  if (g_namespaces->FindNamespaceByClassLoader(env, class_loader, &ns)) {
    CHECK(ns.is_android_namespace());
    return ns.get_android_ns();
    return ns.is_android_namespace() ? ns.get_android_ns() : nullptr;
  }

  return nullptr;