Skip reading VNDK libs for product if not available
If a device do not define "ro.product.vndk.version", we don't need to
initialize the VNDK libraries for them. In that case, return emtpy
string.
Bug: 151992099
Test: atest libnativeloader_test
Change-Id: Ic4d5e0e1162d367e919b5381e3a6c7d048a5e103
diff --git a/libnativeloader/public_libraries.cpp b/libnativeloader/public_libraries.cpp
index b650dc3..9026546 100644
--- a/libnativeloader/public_libraries.cpp
+++ b/libnativeloader/public_libraries.cpp
@@ -270,6 +270,9 @@
}
static std::string InitLlndkLibrariesProduct() {
+ if (!is_product_vndk_version_defined()) {
+ return "";
+ }
std::string config_file = kLlndkLibrariesFile;
InsertVndkVersionStr(&config_file, true);
auto sonames = ReadConfig(config_file, always_true);
@@ -292,6 +295,9 @@
}
static std::string InitVndkspLibrariesProduct() {
+ if (!is_product_vndk_version_defined()) {
+ return "";
+ }
std::string config_file = kVndkLibrariesFile;
InsertVndkVersionStr(&config_file, true);
auto sonames = ReadConfig(config_file, always_true);