From 6e52064e41e6a130f1713c2f422c5bf66a5ff3b7 Mon Sep 17 00:00:00 2001 From: Martin Stjernholm Date: Mon, 29 Jan 2024 19:57:04 +0000 Subject: Give full access to native libs from java libs in the same partition (reland). For both packages and shared java libs in system image partitions (system, product, vendor), load native libraries from the same partition by using the linker namespace for that partition ("default" or "system", "product", "sphal", respectively). This is only done for native libraries in the /lib(64) directories when specified by an absolute path (i.e. use java.lang.System.load rather than loadLibrary). Otherwise it's looked up using the classloader namespace for the package, as before. Since only loads with absolute paths are affected, compat issues are unlikely. However to be on the safe side it's only enabled for SDK level 35 (VIC) and later (regardless of targetSdkVersion of the package, because the affected code is in system image partitions). This is based on a reland of commit 453b9fe909c22eb0f01b3072a5213dd46aed6f45, but with a different solution. It also extends the approach to work for vendor and product partitions. Test: atest libnativeloader_e2e_tests \ libnativeloader_test libnativeloader_lazy_test Test: libnativeloader_e2e_tests on S, Sv2, T, and U platforms in CI Bug: 237577392 Change-Id: If8b74503edfa9229b9eada73968b7d7b5c75ca10 --- libnativeloader/library_namespaces.h | 1 + 1 file changed, 1 insertion(+) (limited to 'libnativeloader/library_namespaces.h') diff --git a/libnativeloader/library_namespaces.h b/libnativeloader/library_namespaces.h index ae1cd88f20..b932a557e0 100644 --- a/libnativeloader/library_namespaces.h +++ b/libnativeloader/library_namespaces.h @@ -53,6 +53,7 @@ using ApiDomain = enum { API_DOMAIN_DEFAULT = 0, // Locations other than those below, in particular for ordinary apps API_DOMAIN_VENDOR = 1, // Vendor partition API_DOMAIN_PRODUCT = 2, // Product partition + API_DOMAIN_SYSTEM = 3, // System and system_ext partitions }; ApiDomain GetApiDomainFromPath(const std::string_view path); -- cgit v1.2.3-59-g8ed1b