Cleanup: update VNDK path
Even though the old VNDK path(/system/lib/vndk-sp-<ver>) is still valid
to use (for older prebuilts), it is merely a symbolic link to VNDK APEX.
As a migration effort to the new VNDK path, this change updates the VNDK
path from /system/lib/vndk-sp-<ver> to /apex/com.android.vndk.v<ver>/lib
Bug: 151635798
Test: atest --test-mapping .
Test: device boots with Q vendor
Change-Id: I7260f1a969e4c7f6923d09382eeb2efec7b6c2cd
diff --git a/base/HidlInternal.cpp b/base/HidlInternal.cpp
index 956effd..e38a664 100644
--- a/base/HidlInternal.cpp
+++ b/base/HidlInternal.cpp
@@ -51,17 +51,7 @@
}
std::string getVndkVersionStr() {
- static std::string vndkVersion("0");
- // "0" means the vndkVersion must be initialized with the property value.
- // Otherwise, return the value.
- if (vndkVersion == "0") {
- vndkVersion = base::GetProperty("ro.vndk.version", "");
- if (vndkVersion != "" && vndkVersion != "current") {
- vndkVersion = "-" + vndkVersion;
- } else {
- vndkVersion = "";
- }
- }
+ static std::string vndkVersion = base::GetProperty("ro.vndk.version", "");
return vndkVersion;
}
diff --git a/base/include/hidl/HidlInternal.h b/base/include/hidl/HidlInternal.h
index 0b80cd4..ee87b87 100644
--- a/base/include/hidl/HidlInternal.h
+++ b/base/include/hidl/HidlInternal.h
@@ -44,8 +44,7 @@
//to avoid creating dependencies on liblog.
void logAlwaysFatal(const char *message);
-// Returns vndk version from "ro.vndk.version" with '-' as a prefix.
-// If "ro.vndk.version" is not set or set to "current", it returns empty string.
+// Returns vndk version from "ro.vndk.version"
std::string getVndkVersionStr();
// Explicitly invokes the parameterized element's destructor;
@@ -115,11 +114,11 @@
};
#define HAL_LIBRARY_PATH_SYSTEM_64BIT "/system/lib64/hw/"
-#define HAL_LIBRARY_PATH_VNDK_SP_64BIT_FOR_VERSION "/system/lib64/vndk-sp%s/hw/"
+#define HAL_LIBRARY_PATH_VNDK_SP_64BIT_FOR_VERSION "/apex/com.android.vndk.v%s/lib64/hw/"
#define HAL_LIBRARY_PATH_VENDOR_64BIT "/vendor/lib64/hw/"
#define HAL_LIBRARY_PATH_ODM_64BIT "/odm/lib64/hw/"
#define HAL_LIBRARY_PATH_SYSTEM_32BIT "/system/lib/hw/"
-#define HAL_LIBRARY_PATH_VNDK_SP_32BIT_FOR_VERSION "/system/lib/vndk-sp%s/hw/"
+#define HAL_LIBRARY_PATH_VNDK_SP_32BIT_FOR_VERSION "/apex/com.android.vndk.v%s/lib/hw/"
#define HAL_LIBRARY_PATH_VENDOR_32BIT "/vendor/lib/hw/"
#define HAL_LIBRARY_PATH_ODM_32BIT "/odm/lib/hw/"