Handle the case when libart.so is not in use
am: 5f28b8460d
* commit '5f28b8460d9e53c5ccbe154ec244c9ae56b4a97c':
Handle the case when libart.so is not in use
diff --git a/libnativeloader/native_loader.cpp b/libnativeloader/native_loader.cpp
index ce893db..3e4b15a 100644
--- a/libnativeloader/native_loader.cpp
+++ b/libnativeloader/native_loader.cpp
@@ -130,7 +130,12 @@
// 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