diff options
-rw-r--r-- | services/sensorservice/Android.mk | 4 | ||||
-rw-r--r-- | services/sensorservice/SensorService.cpp | 5 |
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; |