diff options
author | 2024-01-29 19:57:04 +0000 | |
---|---|---|
committer | 2024-03-18 14:05:45 +0000 | |
commit | 899c4295652ba6c954c1dc590f9c288849f9119c (patch) | |
tree | ba8d87755d6647710ff717568ab798a1d406e9ef /libnativeloader/library_namespaces.h | |
parent | 418b58fe9c94a4bc2592d27b45a8e44c70742119 (diff) |
Give full access to native libs from Java libs in the same partition
(reland 2).
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 <partition root>/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 relands https://r.android.com/2933611 but keeps the vendor and
product API domain checks unchanged in the CreateClassLoaderNamespace
code paths (cf. b/326631342).
Test: atest libnativeloader_e2e_tests \
libnativeloader_test libnativeloader_lazy_test
Test: libnativeloader_e2e_tests on S, Sv2, T, and U platforms in CI
Test: ImsServiceEntitlementUnitTests
Bug: 237577392
Change-Id: I246101c1663d81089d9b4ae9450c28d564a7603a
Diffstat (limited to 'libnativeloader/library_namespaces.h')
-rw-r--r-- | libnativeloader/library_namespaces.h | 1 |
1 files changed, 1 insertions, 0 deletions
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); |