OSDN Git Service

libsensors: workaround sensors never detected marshmallow-x86 android-x86-6.0-r1 android-x86-6.0-r2 android-x86-6.0-r3
authorChih-Wei Huang <cwhuang@linux.org.tw>
Fri, 29 Jul 2016 07:10:51 +0000 (15:10 +0800)
committerChih-Wei Huang <cwhuang@linux.org.tw>
Fri, 29 Jul 2016 07:10:51 +0000 (15:10 +0800)
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

index 57b4bde..f39e5d3 100644 (file)
@@ -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);