From e6ffbc7c0b68f0e4ba862f355a68433bd4294743 Mon Sep 17 00:00:00 2001 From: Chih-Wei Huang Date: Fri, 29 Jul 2016 15:10:51 +0800 Subject: [PATCH] libsensors: workaround sensors never detected Sometimes the iio:devices may not be ready at booting. Assume it's always present. If you want to detect it at runtime, set persist.sys.sensors.iio.present=0. --- hsb/BoardConfig.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hsb/BoardConfig.cpp b/hsb/BoardConfig.cpp index 57b4bde..f39e5d3 100644 --- a/hsb/BoardConfig.cpp +++ b/hsb/BoardConfig.cpp @@ -54,7 +54,7 @@ int BoardConfig::sensorListSize() const char *key = "persist.sys.sensors.iio.present"; char value[PROPERTY_VALUE_MAX]; - if (property_get(key, value, "")) { + if (property_get(key, value, "1")) { if (strncmp(value, "1", 1) == 0) { ALOGI("IIO sensor hub detected previously; assuming it is still attached."); return ARRAY_SIZE(sSensorList); -- 2.11.0