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

Commit c61d083e authored by Ricardo Cerqueira's avatar Ricardo Cerqueira
Browse files

sensors: More compatibility fixes

Some of the old HAL "magic values" aren't magic anymore, so discard
them instead of trying to react like the pre-2.3 implementation.

This had the potential of causing infinite loops on some libsensors (it
was doing it on yamaha's)

Change-Id: Id792faa6a454428040ae2973e386f3a25c904c8e
parent ec458821
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -191,9 +191,11 @@ ssize_t SensorDevice::poll(sensors_event_t* buffer, size_t count) {
            sensors_data_t oldBuffer;
            long result =  mSensorDataDevice->poll(mSensorDataDevice, &oldBuffer);
            if (result == 0x7FFFFFFF) {
                return pollsDone;
                continue;
            }
            if (!oldBuffer.time) {
            if ( oldBuffer.sensor <= 0 ||
                 oldBuffer.sensor > SENSOR_TYPE_ROTATION_VECTOR ||
                 !oldBuffer.time) {
                LOGV("Useless output at round %u from %d",pollsDone,oldBuffer.sensor);
                count--;
                continue;