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

Commit 12548301 authored by Philip Chen's avatar Philip Chen
Browse files

Skip SensorAdditionalInfo in fusion

The Goldfish/Cuttlefish sensor HAL sends SensorAdditionalInfo for
sensor placement when a sensor is newly activated.
(https://developer.android.com/reference/android/hardware/SensorAdditionalInfo#TYPE_SENSOR_PLACEMENT)

Unfortunately, the fusion algorithm in Android sensor framework doesn't
consider the sensor event of SensorAdditionalInfo type.

The fusion algorithm just parses a sensor event for acc/mag/gyro with
SensorAdditionalInfo as the event carries a regular sensor reading in
vec3_t data type, leading to incorrect rotation vector calculation.

Bug: 417564734
Test: CtsUwbMultiDeviceTestCase_FiraRangingTests
Flag: EXEMPT bugfix
Change-Id: I046ba86e09c44dcb39b51777eb30a52cc8dd3730
parent a7b22cf3
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -81,6 +81,9 @@ SensorFusion::SensorFusion()
}

void SensorFusion::process(const sensors_event_t& event) {
    // sensor additional info is not currently used in fusion algorithm
    if (event.type == SENSOR_TYPE_ADDITIONAL_INFO)
        return;

    if (event.sensor == mGyro.getHandle()) {
        float dT;