From 8e76d3645d1d41511e82d4554e49444c51049b22 Mon Sep 17 00:00:00 2001 From: Pawit Pornkitprasan Date: Tue, 27 Dec 2011 19:32:59 +0700 Subject: aries-common: Fix orientation sensor on kernel 3.0 --- init.aries.rc | 1 + libsensors/CompassSensor.cpp | 7 +++++++ 2 files changed, 8 insertions(+) diff --git a/init.aries.rc b/init.aries.rc index 7ac40e5..377de52 100644 --- a/init.aries.rc +++ b/init.aries.rc @@ -196,6 +196,7 @@ service orientationd /system/vendor/bin/orientationd class late_start user compass group system input + disabled service geomagneticd /system/vendor/bin/geomagneticd class late_start 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 #include #include +#include #include @@ -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; -- cgit v1.1