diff options
author | Dimitry Ivanov <dimitry@google.com> | 2016-03-04 11:00:37 -0800 |
---|---|---|
committer | Dimitry Ivanov <dimitry@google.com> | 2016-03-04 15:02:16 -0800 |
commit | 5f28b8460d9e53c5ccbe154ec244c9ae56b4a97c (patch) | |
tree | f08d97d92b08ea48c5950fd468d6bb466eaa9357 /libnativeloader/native_loader.cpp | |
parent | a996c2963a9c1fa9d2339e560c7d6dad2be4a2f8 (diff) |
Handle the case when libart.so is not in use
In the case when libartd.so is used libart.so does not have
to be included in the public namespace.
Bug: http://b/27496326
Change-Id: I464bafec1d9da5c3f3f03fef02af3f34bf377297
Diffstat (limited to 'libnativeloader/native_loader.cpp')
-rw-r--r-- | libnativeloader/native_loader.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/libnativeloader/native_loader.cpp b/libnativeloader/native_loader.cpp index ce893db0f..3e4b15a01 100644 --- a/libnativeloader/native_loader.cpp +++ b/libnativeloader/native_loader.cpp @@ -130,7 +130,12 @@ class LibraryNamespaces { // TODO (dimitry): This is a workaround for http://b/26436837 // will be removed before the release. if (target_sdk_version <= 23) { - publicNativeLibraries += ":libart.so"; + // check if libart.so is loaded. + void* handle = dlopen("libart.so", RTLD_NOW | RTLD_NOLOAD); + if (handle != nullptr) { + publicNativeLibraries += ":libart.so"; + dlclose(handle); + } } // END OF WORKAROUND |