From 14626a7c40471090745b7069310a6c6265671fc9 Mon Sep 17 00:00:00 2001 From: Jiyong Park Date: Thu, 2 Jul 2020 23:17:58 +0900 Subject: 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 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 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 Merged-In: I52e23dda58fc69f51451c5dbeffd0a77125c9bff (cherry picked from commit e741dfd18dcd15f002bc1db9bd6634322e4eeef8) Change-Id: I52e23dda58fc69f51451c5dbeffd0a77125c9bff --- libnativeloader/library_namespaces.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'libnativeloader/library_namespaces.h') diff --git a/libnativeloader/library_namespaces.h b/libnativeloader/library_namespaces.h index c41f2e461f..4871528f47 100644 --- a/libnativeloader/library_namespaces.h +++ b/libnativeloader/library_namespaces.h @@ -55,7 +55,8 @@ class LibraryNamespaces { } Result Create(JNIEnv* env, uint32_t target_sdk_version, jobject class_loader, bool is_shared, jstring dex_path, - jstring java_library_path, jstring java_permitted_path); + jstring java_library_path, jstring java_permitted_path, + jstring uses_library_list); NativeLoaderNamespace* FindNamespaceByClassLoader(JNIEnv* env, jobject class_loader); private: -- cgit v1.2.3-59-g8ed1b