Fix VNDK path
Previously, isRunningInVndkNamespace returns true if the shared object
is loaded from the path including "/vndk-sp".
This change fixes it to use a new VNDK path.
And also getVndkSysLibPath() is amended as well.
Bug: 151635128
Test: build
Merged-In: Ic2d5040a14b960562ffcba0d5589d120bd27c6aa
Change-Id: Ic2d5040a14b960562ffcba0d5589d120bd27c6aa
(cherry picked from commit dc42cee700bf2ae1b9fb789455ea5110b30f69ad)
diff --git a/cpu_ref/rsCpuScript.h b/cpu_ref/rsCpuScript.h
index a8f0db6..e9feb1c 100644
--- a/cpu_ref/rsCpuScript.h
+++ b/cpu_ref/rsCpuScript.h
@@ -157,17 +157,14 @@
#ifdef __LP64__
#define SYSLIBPATH "/system/lib64"
-#define SYSLIBPATH_VNDK "/system/lib64/vndk-sp"
#define SYSLIBPATH_BC "/system/lib64"
#define SYSLIBPATH_VENDOR "/system/vendor/lib64"
#elif defined(BUILD_ARM_FOR_X86) && defined(__arm__)
#define SYSLIBPATH "/system/lib/arm"
-#define SYSLIBPATH_VNDK "/system/lib/arm/vndk-sp"
#define SYSLIBPATH_BC "/system/lib"
#define SYSLIBPATH_VENDOR "/system/vendor/lib/arm"
#else
#define SYSLIBPATH "/system/lib"
-#define SYSLIBPATH_VNDK "/system/lib/vndk-sp"
#define SYSLIBPATH_BC "/system/lib"
#define SYSLIBPATH_VENDOR "/system/vendor/lib"
#endif
@@ -197,11 +194,11 @@
inline std::string getVndkSysLibPath() {
char buf[PROP_VALUE_MAX];
android::renderscript::property_get("ro.vndk.version", buf, "");
- std::string versionStr = buf;
- if (versionStr != "" && versionStr != "current") {
- return SYSLIBPATH_VNDK "-" + versionStr;
- }
- return SYSLIBPATH_VNDK;
+ std::string vndk_path = "/apex/com.android.vndk.v" + std::string(buf) + "/lib";
+ #ifdef __LP64__
+ vndk_path += "64";
+ #endif
+ return vndk_path;
}
} // anonymous namespace