diff options
author | Jiyong Park <jiyong@google.com> | 2020-07-02 23:17:58 +0900 |
---|---|---|
committer | Jiyong Park <jiyong@google.com> | 2020-07-23 08:56:35 +0000 |
commit | e741dfd18dcd15f002bc1db9bd6634322e4eeef8 (patch) | |
tree | b16eeb0fde0b8ad3bbb7111b6965cbcb199434cb /libnativeloader/native_loader_lazy.cpp | |
parent | 7a46e7c0b6ab033357080b8fcb5168baad2f4000 (diff) |
libnativeloader understands uses-native-library tag
Previously, libnativeloader provided all the partner-provided public
shared libraries to apps unconditionally. Starting from Android S, apps
targeting S (or higher) get only the libs that are explicited listed
as dependencies using the <uses-native-library> tag in the app manifest.
The libs not listed there are not available to the app even if they are
registered as public libraries.
The changed behavior affects new (S+) apps. Existing apps are not
affected; they still get all the libraries.
The implementation is rather straightforward. The library accepts a new
parameter soname_list from the framework, which is actually from the
<uses-native-library> tags of the app manifest. The list is used to
filter the partner-provided libraries when the target sdk is > 30.
Bug: 142191088
Test: atest CtsUsesNativeLibraryTest
Change-Id: I52e23dda58fc69f51451c5dbeffd0a77125c9bff
Diffstat (limited to 'libnativeloader/native_loader_lazy.cpp')
-rw-r--r-- | libnativeloader/native_loader_lazy.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/libnativeloader/native_loader_lazy.cpp b/libnativeloader/native_loader_lazy.cpp index 05d339abf9..49b22ea848 100644 --- a/libnativeloader/native_loader_lazy.cpp +++ b/libnativeloader/native_loader_lazy.cpp @@ -51,10 +51,10 @@ void InitializeNativeLoader() { jstring CreateClassLoaderNamespace(JNIEnv* env, int32_t target_sdk_version, jobject class_loader, bool is_shared, jstring dex_path, jstring library_path, - jstring permitted_path) { + jstring permitted_path, jstring uses_library_list) { static auto f = GET_FUNC_PTR(CreateClassLoaderNamespace); return f(env, target_sdk_version, class_loader, is_shared, dex_path, library_path, - permitted_path); + permitted_path, uses_library_list); } void* OpenNativeLibrary(JNIEnv* env, int32_t target_sdk_version, const char* path, |