summaryrefslogtreecommitdiff
path: root/libnativeloader/library_namespaces.cpp
diff options
context:
space:
mode:
author Martin Stjernholm <mast@google.com> 2022-07-27 02:10:03 +0100
committer Martin Stjernholm <mast@google.com> 2022-09-09 17:36:29 +0000
commitc55265c083eee1af192e8f34bc0096e593f3a211 (patch)
tree5bee8323a6270878235173447cda90bbabc51eb4 /libnativeloader/library_namespaces.cpp
parent488517a2ad08abbfd095eb5b7da11313c9e07efd (diff)
Use a different name for the product classloader namespace.
This is a correction - it reused the vendor classloader namspace name by mistake when product apps were introduced. Test: `atest libnativeloader_e2e_tests` and look at logcat messages Bug: 137356719 Change-Id: I3e8cfcb9ed8112bb0144ff2ea53fe7a8bcb63694
Diffstat (limited to 'libnativeloader/library_namespaces.cpp')
-rw-r--r--libnativeloader/library_namespaces.cpp17
1 files changed, 9 insertions, 8 deletions
diff --git a/libnativeloader/library_namespaces.cpp b/libnativeloader/library_namespaces.cpp
index 96d4ddeac6..0d038f54ab 100644
--- a/libnativeloader/library_namespaces.cpp
+++ b/libnativeloader/library_namespaces.cpp
@@ -64,15 +64,16 @@ constexpr const char* kVndkProductNamespaceName = "vndk_product";
// system namespace with the names of libs listed in the public.libraries.txt.
// This way an app can only load its own JNI libraries along with the public libs.
constexpr const char* kClassloaderNamespaceName = "classloader-namespace";
-// Same thing for vendor APKs.
+// Same thing for unbundled vendor APKs.
constexpr const char* kVendorClassloaderNamespaceName = "vendor-classloader-namespace";
-// If the namespace is shared then add this suffix to form
-// "classloader-namespace-shared" or "vendor-classloader-namespace-shared",
-// respectively. A shared namespace (cf. ANDROID_NAMESPACE_TYPE_SHARED) has
+// Same thing for unbundled product APKs.
+constexpr const char* kProductClassloaderNamespaceName = "product-classloader-namespace";
+// If the namespace is shared then add this suffix to help identify it in debug
+// messages. A shared namespace (cf. ANDROID_NAMESPACE_TYPE_SHARED) has
// inherited all the libraries of the parent classloader namespace, or the
-// system namespace for the main app classloader. It is used to give full
-// access to the platform libraries for apps bundled in the system image,
-// including their later updates installed in /data.
+// system namespace for the main app classloader. It is used to give full access
+// to the platform libraries for apps bundled in the system image, including
+// their later updates installed in /data.
constexpr const char* kSharedNamespaceSuffix = "-shared";
// (http://b/27588281) This is a workaround for apps using custom classloaders and calling
@@ -262,7 +263,7 @@ Result<NativeLoaderNamespace*> LibraryNamespaces::Create(JNIEnv* env, uint32_t t
system_exposed_libraries = system_exposed_libraries + ':' + llndk_libraries_product();
// Different name is useful for debugging
- namespace_name = kVendorClassloaderNamespaceName;
+ namespace_name = kProductClassloaderNamespaceName;
}
}