summaryrefslogtreecommitdiffstats
path: root/libnativeloader/native_loader.cpp
diff options
context:
space:
mode:
authorDimitry Ivanov <dimitry@google.com>2016-05-24 08:37:05 -0700
committerDimitry Ivanov <dimitry@google.com>2016-05-24 08:40:38 -0700
commit94ee4e690dc4e529a27561b9e0d1e52a0dddc7d5 (patch)
treee4a2e74652f473c8e79b5bf589a1ca792e7f6e11 /libnativeloader/native_loader.cpp
parent70a46d674a04e95da633a5914abd7a55a46e2b3e (diff)
downloadsystem_core-94ee4e690dc4e529a27561b9e0d1e52a0dddc7d5.tar.gz
system_core-94ee4e690dc4e529a27561b9e0d1e52a0dddc7d5.tar.bz2
system_core-94ee4e690dc4e529a27561b9e0d1e52a0dddc7d5.zip
Remove target_sdk_version parameter
Since linker-namespaces are enabled for all target_sdk_versions and there is no longer need in workarounds in libnativeloader - remove unused target_sdk_version parameter for internal calls. This also brings libnativeloader closer to aosp/master Bug: http://b/26040253 Change-Id: I7d6f6ac31be0dca5f3c3f6ea20e6cc87ce3a3c7f
Diffstat (limited to 'libnativeloader/native_loader.cpp')
-rw-r--r--libnativeloader/native_loader.cpp17
1 files changed, 6 insertions, 11 deletions
diff --git a/libnativeloader/native_loader.cpp b/libnativeloader/native_loader.cpp
index 0600b9e40..64847439a 100644
--- a/libnativeloader/native_loader.cpp
+++ b/libnativeloader/native_loader.cpp
@@ -59,8 +59,7 @@ class LibraryNamespaces {
jobject class_loader,
bool is_shared,
jstring java_library_path,
- jstring java_permitted_path,
- int32_t target_sdk_version) {
+ jstring java_permitted_path) {
std::string library_path; // empty string by default.
if (java_library_path != nullptr) {
@@ -83,7 +82,7 @@ class LibraryNamespaces {
}
}
- if (!initialized_ && !InitPublicNamespace(library_path.c_str(), target_sdk_version)) {
+ if (!initialized_ && !InitPublicNamespace(library_path.c_str())) {
return nullptr;
}
@@ -188,15 +187,12 @@ class LibraryNamespaces {
return true;
}
- bool InitPublicNamespace(const char* library_path, int32_t target_sdk_version) {
- std::string publicNativeLibraries = public_libraries_;
-
- UNUSED(target_sdk_version);
+ bool InitPublicNamespace(const char* library_path) {
// (http://b/25844435) - Some apps call dlopen from generated code (mono jited
// code is one example) unknown to linker in which case linker uses anonymous
// namespace. The second argument specifies the search path for the anonymous
// namespace which is the library_path of the classloader.
- initialized_ = android_init_namespaces(publicNativeLibraries.c_str(), library_path);
+ initialized_ = android_init_namespaces(public_libraries_.c_str(), library_path);
return initialized_;
}
@@ -263,8 +259,7 @@ jstring CreateClassLoaderNamespace(JNIEnv* env,
class_loader,
is_shared,
library_path,
- permitted_path,
- target_sdk_version);
+ permitted_path);
if (ns == nullptr) {
return env->NewStringUTF(dlerror());
}
@@ -292,7 +287,7 @@ void* OpenNativeLibrary(JNIEnv* env,
if (ns == nullptr) {
// This is the case where the classloader was not created by ApplicationLoaders
// In this case we create an isolated not-shared namespace for it.
- ns = g_namespaces->Create(env, class_loader, false, library_path, nullptr, target_sdk_version);
+ ns = g_namespaces->Create(env, class_loader, false, library_path, nullptr);
if (ns == nullptr) {
return nullptr;
}