summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Hillenbrand <codeworkx@cyanogenmod.org>2013-05-01 19:15:46 +0200
committerDaniel Hillenbrand <codeworkx@cyanogenmod.org>2013-05-01 19:15:46 +0200
commitab5fe40c78016ba8de078fd2a0e5d4d7dc115b22 (patch)
tree55d385fe85adf92ab7f6e8751a414e111390f020
parent8310b9df8bb913ff4990ddc9a42781737a6aca3c (diff)
downloadframeworks_native-ab5fe40c78016ba8de078fd2a0e5d4d7dc115b22.zip
frameworks_native-ab5fe40c78016ba8de078fd2a0e5d4d7dc115b22.tar.gz
frameworks_native-ab5fe40c78016ba8de078fd2a0e5d4d7dc115b22.tar.bz2
native: add flag to disable legacy sensors fusion
Causes problems on all p31xx devices. http://pastebin.com/PabjFVWP Change-Id: Iac9a913e0984d7e9e419772215d3fb3d1a0cb5e8
-rw-r--r--services/sensorservice/Android.mk4
-rw-r--r--services/sensorservice/SensorService.cpp5
2 files changed, 9 insertions, 0 deletions
diff --git a/services/sensorservice/Android.mk b/services/sensorservice/Android.mk
index c5926c6..0214d7e 100644
--- a/services/sensorservice/Android.mk
+++ b/services/sensorservice/Android.mk
@@ -33,6 +33,10 @@ LOCAL_SHARED_LIBRARIES := \
libui \
libgui
+ifneq ($(BOARD_USE_LEGACY_SENSORS_FUSION),false)
+ LOCAL_CFLAGS += -DUSE_LEGACY_SENSORS_FUSION
+endif
+
ifneq ($(BOARD_SYSFS_LIGHT_SENSOR),)
LOCAL_CFLAGS += -DSYSFS_LIGHT_SENSOR=\"$(BOARD_SYSFS_LIGHT_SENSOR)\"
endif
diff --git a/services/sensorservice/SensorService.cpp b/services/sensorservice/SensorService.cpp
index be1c150..cd523ce 100644
--- a/services/sensorservice/SensorService.cpp
+++ b/services/sensorservice/SensorService.cpp
@@ -48,9 +48,12 @@
#include "RotationVectorSensor2.h"
#include "SensorFusion.h"
#include "SensorService.h"
+
+#ifdef USE_LEGACY_SENSORS_FUSION
#include "legacy/LegacyGravitySensor.h"
#include "legacy/LegacyLinearAccelerationSensor.h"
#include "legacy/LegacyRotationVectorSensor.h"
+#endif
namespace android {
// ---------------------------------------------------------------------------
@@ -123,12 +126,14 @@ void SensorService::onFirstRef()
registerVirtualSensor( new OrientationSensor() );
registerVirtualSensor( new CorrectedGyroSensor(list, count) );
}
+#ifdef USE_LEGACY_SENSORS_FUSION
else
{
registerVirtualSensor( new LegacyRotationVectorSensor() );
registerVirtualSensor( new LegacyGravitySensor(list, count) );
registerVirtualSensor( new LegacyLinearAccelerationSensor(list, count) );
}
+#endif
// build the sensor list returned to users
mUserSensorList = mSensorList;