summaryrefslogtreecommitdiffstats
path: root/libsensors/OrientationSensor.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'libsensors/OrientationSensor.cpp')
-rw-r--r--libsensors/OrientationSensor.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/libsensors/OrientationSensor.cpp b/libsensors/OrientationSensor.cpp
index 2925ba7..d0c97af 100644
--- a/libsensors/OrientationSensor.cpp
+++ b/libsensors/OrientationSensor.cpp
@@ -21,6 +21,7 @@
#include <unistd.h>
#include <dirent.h>
#include <sys/select.h>
+#include <cutils/properties.h>
#include <cutils/log.h>
@@ -85,6 +86,12 @@ int OrientationSensor::enable(int32_t, int en) {
close(fd);
mEnabled = flags;
//setInitialState();
+
+ /* Since the migration to 3.0 kernel, orientationd doesn't poll
+ * the enabled state properly, so start it when it's enabled and
+ * stop it when we're done using it.
+ */
+ property_set(mEnabled ? "ctl.start" : "ctl.stop", "orientationd");
return 0;
}
return -1;