summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Treehugger Robot <android-test-infra-autosubmit@system.gserviceaccount.com> 2023-08-18 17:30:15 +0000
committer Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> 2023-08-18 17:30:15 +0000
commit423deec654485aaf2bb431e6e7438c332f5b366d (patch)
treec963dae9c856226c5f167feb1a6a44f63931db94
parentbe8ef46e0817bd8c71b3eedb5f1bf07eddd8266d (diff)
parentc5414a7c8c404e0c30c2904e763ba3f0beb4671c (diff)
Merge "Use llndk.libraries.txt from system if VNDK is deprecated" into main am: b2d6cc2e41 am: 95c85d27bb am: a8e994b05b am: c5414a7c8c
Original change: https://android-review.googlesource.com/c/platform/frameworks/native/+/2703694 Change-Id: I5f51bbcfede94d18e1ade85ef1dc8d1e735de1f1 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
-rw-r--r--libs/graphicsenv/GraphicsEnv.cpp23
1 files changed, 21 insertions, 2 deletions
diff --git a/libs/graphicsenv/GraphicsEnv.cpp b/libs/graphicsenv/GraphicsEnv.cpp
index 732ca36b44..4842476222 100644
--- a/libs/graphicsenv/GraphicsEnv.cpp
+++ b/libs/graphicsenv/GraphicsEnv.cpp
@@ -60,6 +60,17 @@ typedef bool (*fpANGLEShouldBeUsedForApplication)(void* rulesHandle, int rulesVe
typedef bool (*fpANGLEFreeRulesHandle)(void* handle);
typedef bool (*fpANGLEFreeSystemInfoHandle)(void* handle);
+namespace {
+static bool isVndkEnabled() {
+#ifdef __BIONIC__
+ // TODO(b/290159430) Use ro.vndk.version to check if VNDK is enabled instead
+ static bool isVndkEnabled = !android::base::GetBoolProperty("ro.vndk.deprecate", false);
+ return isVndkEnabled;
+#endif
+ return false;
+}
+} // namespace
+
namespace android {
enum NativeLibrary {
@@ -71,6 +82,8 @@ static constexpr const char* kNativeLibrariesSystemConfigPath[] =
{"/apex/com.android.vndk.v{}/etc/llndk.libraries.{}.txt",
"/apex/com.android.vndk.v{}/etc/vndksp.libraries.{}.txt"};
+static const char* kLlndkLibrariesTxtPath = "/system/etc/llndk.libraries.txt";
+
static std::string vndkVersionStr() {
#ifdef __BIONIC__
return base::GetProperty("ro.vndk.version", "");
@@ -108,8 +121,14 @@ static bool readConfig(const std::string& configFile, std::vector<std::string>*
}
static const std::string getSystemNativeLibraries(NativeLibrary type) {
- std::string nativeLibrariesSystemConfig = kNativeLibrariesSystemConfigPath[type];
- insertVndkVersionStr(&nativeLibrariesSystemConfig);
+ std::string nativeLibrariesSystemConfig = "";
+
+ if (!isVndkEnabled() && type == NativeLibrary::LLNDK) {
+ nativeLibrariesSystemConfig = kLlndkLibrariesTxtPath;
+ } else {
+ nativeLibrariesSystemConfig = kNativeLibrariesSystemConfigPath[type];
+ insertVndkVersionStr(&nativeLibrariesSystemConfig);
+ }
std::vector<std::string> soNames;
if (!readConfig(nativeLibrariesSystemConfig, &soNames)) {