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

Commit 03193066 authored by Mathias Agopian's avatar Mathias Agopian
Browse files

various fixes to the sensorservice

1) "google" sensors are now reporting AOSP as the vendor string
2) don't expose the system's sensor fusion if the HAL provides it
3) use uncalibrated gyro if availble for the system's sensor fusion

Change-Id: I25140436cdb29d55e39fd6fbbf8c44a410a83d5c
parent 59eaeed5
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -69,7 +69,7 @@ status_t CorrectedGyroSensor::setDelay(void* ident, int handle, int64_t ns) {
Sensor CorrectedGyroSensor::getSensor() const {
    sensor_t hwSensor;
    hwSensor.name       = "Corrected Gyroscope Sensor";
    hwSensor.vendor     = "Google Inc.";
    hwSensor.vendor     = "AOSP";
    hwSensor.version    = 1;
    hwSensor.handle     = '_cgy';
    hwSensor.type       = SENSOR_TYPE_GYROSCOPE;
+1 −1
Original line number Diff line number Diff line
@@ -77,7 +77,7 @@ status_t GravitySensor::setDelay(void* ident, int handle, int64_t ns) {
Sensor GravitySensor::getSensor() const {
    sensor_t hwSensor;
    hwSensor.name       = "Gravity Sensor";
    hwSensor.vendor     = "Google Inc.";
    hwSensor.vendor     = "AOSP";
    hwSensor.version    = 3;
    hwSensor.handle     = '_grv';
    hwSensor.type       = SENSOR_TYPE_GRAVITY;
+1 −1
Original line number Diff line number Diff line
@@ -62,7 +62,7 @@ Sensor LinearAccelerationSensor::getSensor() const {
    Sensor gsensor(mGravitySensor.getSensor());
    sensor_t hwSensor;
    hwSensor.name       = "Linear Acceleration Sensor";
    hwSensor.vendor     = "Google Inc.";
    hwSensor.vendor     = "AOSP";
    hwSensor.version    = gsensor.getVersion();
    hwSensor.handle     = '_lin';
    hwSensor.type       = SENSOR_TYPE_LINEAR_ACCELERATION;
+4 −1
Original line number Diff line number Diff line
@@ -33,6 +33,9 @@ OrientationSensor::OrientationSensor()
    : mSensorDevice(SensorDevice::getInstance()),
      mSensorFusion(SensorFusion::getInstance())
{
    // FIXME: instead of using the SensorFusion code, we should use
    // the SENSOR_TYPE_ROTATION_VECTOR instead. This way we could use the
    // HAL's implementation.
}

bool OrientationSensor::process(sensors_event_t* outEvent,
@@ -73,7 +76,7 @@ status_t OrientationSensor::setDelay(void* ident, int handle, int64_t ns) {
Sensor OrientationSensor::getSensor() const {
    sensor_t hwSensor;
    hwSensor.name       = "Orientation Sensor";
    hwSensor.vendor     = "Google Inc.";
    hwSensor.vendor     = "AOSP";
    hwSensor.version    = 1;
    hwSensor.handle     = '_ypr';
    hwSensor.type       = SENSOR_TYPE_ORIENTATION;
+2 −2
Original line number Diff line number Diff line
@@ -63,7 +63,7 @@ status_t RotationVectorSensor::setDelay(void* ident, int handle, int64_t ns) {
Sensor RotationVectorSensor::getSensor() const {
    sensor_t hwSensor;
    hwSensor.name       = "Rotation Vector Sensor";
    hwSensor.vendor     = "Google Inc.";
    hwSensor.vendor     = "AOSP";
    hwSensor.version    = 3;
    hwSensor.handle     = '_rov';
    hwSensor.type       = SENSOR_TYPE_ROTATION_VECTOR;
@@ -112,7 +112,7 @@ status_t GyroDriftSensor::setDelay(void* ident, int handle, int64_t ns) {
Sensor GyroDriftSensor::getSensor() const {
    sensor_t hwSensor;
    hwSensor.name       = "Gyroscope Bias (debug)";
    hwSensor.vendor     = "Google Inc.";
    hwSensor.vendor     = "AOSP";
    hwSensor.version    = 1;
    hwSensor.handle     = '_gbs';
    hwSensor.type       = SENSOR_TYPE_ACCELEROMETER;
Loading