Renderscript: Don't call property_get on host
Accessing system properties only makes sense on the target, not
on the host.
This change is needed to remove host support for properties.
Change-Id: I41a34bdeae6a1e9a1481f2ecc80e69ead3bd0556
diff --git a/lib/Renderscript/RSCompilerDriver.cpp b/lib/Renderscript/RSCompilerDriver.cpp
index bf18667..fd12760 100644
--- a/lib/Renderscript/RSCompilerDriver.cpp
+++ b/lib/Renderscript/RSCompilerDriver.cpp
@@ -32,7 +32,9 @@
#include "bcc/Support/Sha1Util.h"
#include "bcc/Support/OutputFile.h"
+#ifdef HAVE_ANDROID_OS
#include <cutils/properties.h>
+#endif
#include <utils/String8.h>
#include <utils/StopWatch.h>
@@ -41,6 +43,9 @@
namespace {
bool is_force_recompile() {
+#ifndef HAVE_ANDROID_OS
+ return false;
+#else
char buf[PROPERTY_VALUE_MAX];
// Re-compile if floating point precision has been overridden.
@@ -56,6 +61,7 @@
} else {
return false;
}
+#endif
}
} // end anonymous namespace
diff --git a/lib/Renderscript/RSInfo.cpp b/lib/Renderscript/RSInfo.cpp
index 4aa2e69..b289079 100644
--- a/lib/Renderscript/RSInfo.cpp
+++ b/lib/Renderscript/RSInfo.cpp
@@ -26,7 +26,9 @@
#include "bcc/Support/FileBase.h"
#include "bcc/Support/Log.h"
+#ifdef HAVE_ANDROID_OS
#include <cutils/properties.h>
+#endif
using namespace bcc;
@@ -389,6 +391,7 @@
result = FP_Relaxed;
}
+#ifdef HAVE_ANDROID_OS
// Provide an override for precsion via adb shell setprop
// adb shell setprop debug.rs.precision rs_fp_full
// adb shell setprop debug.rs.precision rs_fp_relaxed
@@ -408,6 +411,7 @@
result = FP_Full;
}
}
+#endif
return result;
}