summaryrefslogtreecommitdiffstats
path: root/libsensors
diff options
context:
space:
mode:
authorPawit Pornkitprasan <p.pawit@gmail.com>2012-04-06 10:17:48 +0700
committerPawit Pornkitprasan <p.pawit@gmail.com>2012-04-06 10:17:52 +0700
commit54645c6aa63a15de665c95d217c0589124d79022 (patch)
treea15721197531f4ac9d4d6a212d557203dbce470a /libsensors
parent3428eef92f9e92fced9a123993b689dd95ecd114 (diff)
downloaddevice_samsung_aries-common-54645c6aa63a15de665c95d217c0589124d79022.zip
device_samsung_aries-common-54645c6aa63a15de665c95d217c0589124d79022.tar.gz
device_samsung_aries-common-54645c6aa63a15de665c95d217c0589124d79022.tar.bz2
aries-common: Fix orientation sensor
The orientation sensor will not work if the magnetic sensor was started before because the "orientationd restart hack" was put in the wrong file.
Diffstat (limited to 'libsensors')
-rw-r--r--libsensors/CompassSensor.cpp7
-rw-r--r--libsensors/OrientationSensor.cpp7
2 files changed, 7 insertions, 7 deletions
diff --git a/libsensors/CompassSensor.cpp b/libsensors/CompassSensor.cpp
index 4ed3e20..f4b3685 100644
--- a/libsensors/CompassSensor.cpp
+++ b/libsensors/CompassSensor.cpp
@@ -21,7 +21,6 @@
#include <unistd.h>
#include <dirent.h>
#include <sys/select.h>
-#include <cutils/properties.h>
#include <cutils/log.h>
@@ -89,12 +88,6 @@ int CompassSensor::enable(int32_t, int en) {
err = write(fd, buf, sizeof(buf));
close(fd);
mEnabled = flags;
-
- /* 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;
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;