diff options
author | Dimitry Ivanov <dimitry@google.com> | 2016-11-01 14:17:00 -0700 |
---|---|---|
committer | Dimitry Ivanov <dimitry@google.com> | 2016-11-01 14:48:45 -0700 |
commit | 800083d229fbf4ab4008e73205679556b058748b (patch) | |
tree | e9215c9cf8e797daf6f24232d3b1d4b176b982c4 /libnativeloader | |
parent | 0945380e36e4106a643af0a6e756fdc3487cfee2 (diff) | |
download | system_core-800083d229fbf4ab4008e73205679556b058748b.tar.gz system_core-800083d229fbf4ab4008e73205679556b058748b.tar.bz2 system_core-800083d229fbf4ab4008e73205679556b058748b.zip |
Return nullptr from FindNamespaceByClassLoader for NB-enabled apps.
This function is always called by the frameworks in order to
initialize vulkan layer path. For NB apps returning nullptr
disables vulkan layer library lookup as expected.
Bug: http://b/32542970
Test: mm
Change-Id: I426b2b9f5ea7227b00f063ed6040f37bb2b4f21f
Diffstat (limited to 'libnativeloader')
-rw-r--r-- | libnativeloader/native_loader.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/libnativeloader/native_loader.cpp b/libnativeloader/native_loader.cpp index fb95cb63d..e09cce3e3 100644 --- a/libnativeloader/native_loader.cpp +++ b/libnativeloader/native_loader.cpp @@ -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; |