From c55265c083eee1af192e8f34bc0096e593f3a211 Mon Sep 17 00:00:00 2001 From: Martin Stjernholm Date: Wed, 27 Jul 2022 02:10:03 +0100 Subject: 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 --- libnativeloader/library_namespaces.cpp | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) (limited to 'libnativeloader/library_namespaces.cpp') 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 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; } } -- cgit v1.2.3-59-g8ed1b