Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d4313ca8 authored by Daniel Hillenbrand's avatar Daniel Hillenbrand Committed by Steve Kondik
Browse files

native: add flag to disable legacy sensors fusion

Causes problems on all p31xx devices.
http://pastebin.com/PabjFVWP

Change-Id: Iac9a913e0984d7e9e419772215d3fb3d1a0cb5e8
parent f21f1c5b
Loading
Loading
Loading
Loading
+4 −0
Original line number Original line Diff line number Diff line
@@ -35,6 +35,10 @@ LOCAL_SHARED_LIBRARIES := \
	libui \
	libui \
	libgui
	libgui


ifneq ($(BOARD_USE_LEGACY_SENSORS_FUSION),false)
    LOCAL_CFLAGS += -DUSE_LEGACY_SENSORS_FUSION
endif

ifneq ($(BOARD_SYSFS_LIGHT_SENSOR),)
ifneq ($(BOARD_SYSFS_LIGHT_SENSOR),)
    LOCAL_CFLAGS += -DSYSFS_LIGHT_SENSOR=\"$(BOARD_SYSFS_LIGHT_SENSOR)\"
    LOCAL_CFLAGS += -DSYSFS_LIGHT_SENSOR=\"$(BOARD_SYSFS_LIGHT_SENSOR)\"
endif
endif
+5 −0
Original line number Original line Diff line number Diff line
@@ -49,9 +49,12 @@
#include "RotationVectorSensor2.h"
#include "RotationVectorSensor2.h"
#include "SensorFusion.h"
#include "SensorFusion.h"
#include "SensorService.h"
#include "SensorService.h"

#ifdef USE_LEGACY_SENSORS_FUSION
#include "legacy/LegacyGravitySensor.h"
#include "legacy/LegacyGravitySensor.h"
#include "legacy/LegacyLinearAccelerationSensor.h"
#include "legacy/LegacyLinearAccelerationSensor.h"
#include "legacy/LegacyRotationVectorSensor.h"
#include "legacy/LegacyRotationVectorSensor.h"
#endif


namespace android {
namespace android {
// ---------------------------------------------------------------------------
// ---------------------------------------------------------------------------
@@ -126,12 +129,14 @@ void SensorService::onFirstRef()
                registerVirtualSensor( new OrientationSensor() );
                registerVirtualSensor( new OrientationSensor() );
                registerVirtualSensor( new CorrectedGyroSensor(list, count) );
                registerVirtualSensor( new CorrectedGyroSensor(list, count) );
            }
            }
#ifdef USE_LEGACY_SENSORS_FUSION
            else
            else
            {
            {
                registerVirtualSensor( new LegacyRotationVectorSensor() );
                registerVirtualSensor( new LegacyRotationVectorSensor() );
                registerVirtualSensor( new LegacyGravitySensor(list, count) );
                registerVirtualSensor( new LegacyGravitySensor(list, count) );
                registerVirtualSensor( new LegacyLinearAccelerationSensor(list, count) );
                registerVirtualSensor( new LegacyLinearAccelerationSensor(list, count) );
            }
            }
#endif


            // build the sensor list returned to users
            // build the sensor list returned to users
            mUserSensorList = mSensorList;
            mUserSensorList = mSensorList;