diff options
author | Pawit Pornkitprasan <p.pawit@gmail.com> | 2011-12-27 19:32:59 +0700 |
---|---|---|
committer | Pawit Pornkitprasan <p.pawit@gmail.com> | 2011-12-27 19:32:59 +0700 |
commit | 8e76d3645d1d41511e82d4554e49444c51049b22 (patch) | |
tree | 97c8fcd261739e4e33b29fe905d351a1b2006dd7 /libsensors | |
parent | 82aa70e3ecee1901413186047de1a3e865ea9169 (diff) | |
download | device_samsung_aries-common-8e76d3645d1d41511e82d4554e49444c51049b22.zip device_samsung_aries-common-8e76d3645d1d41511e82d4554e49444c51049b22.tar.gz device_samsung_aries-common-8e76d3645d1d41511e82d4554e49444c51049b22.tar.bz2 |
aries-common: Fix orientation sensor on kernel 3.0
Diffstat (limited to 'libsensors')
-rw-r--r-- | libsensors/CompassSensor.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/libsensors/CompassSensor.cpp b/libsensors/CompassSensor.cpp index f4b3685..4ed3e20 100644 --- a/libsensors/CompassSensor.cpp +++ b/libsensors/CompassSensor.cpp @@ -21,6 +21,7 @@ #include <unistd.h> #include <dirent.h> #include <sys/select.h> +#include <cutils/properties.h> #include <cutils/log.h> @@ -88,6 +89,12 @@ 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; |