Make product libs available to unbundled product apks.
Unbundling product apps must be triggerred if the target is enforcing
the product interfaces. The device must have ro.product.vndk.version
property if its product interface is enforced.
Unbundled product apps can use product libraries.
Bug: 144534640
Bug: 127738095
Bug: 128557860
Test: check boot and basic features
Change-Id: I32b2a1bd3e4f62b6acdbfab6bd277ec1132478a2
diff --git a/libnativeloader/public_libraries.cpp b/libnativeloader/public_libraries.cpp
index d58b4ea..40f002f 100644
--- a/libnativeloader/public_libraries.cpp
+++ b/libnativeloader/public_libraries.cpp
@@ -30,6 +30,10 @@
#include <android-base/strings.h>
#include <log/log.h>
+#if defined(__ANDROID__)
+#include <android/sysprop/VndkProperties.sysprop.h>
+#endif
+
#include "utils.h"
namespace android::nativeloader {
@@ -324,6 +328,14 @@
return list;
}
+bool is_product_vndk_version_defined() {
+#if defined(__ANDROID__)
+ return android::sysprop::VndkProperties::product_vndk_version().has_value();
+#else
+ return false;
+#endif
+}
+
namespace internal {
// Exported for testing
Result<std::vector<std::string>> ParseConfig(