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

Commit 007e8d24 authored by Mathias Agopian's avatar Mathias Agopian Committed by Android Git Automerger
Browse files

am 92b56b8c: am e90c4998: Merge "fix [4025681] continuous sensors should not...

am 92b56b8c: am e90c4998: Merge "fix [4025681] continuous sensors should not try to send an event as soon as they\'re activated" into honeycomb-mr1

* commit '92b56b8c':
  fix [4025681] continuous sensors should not try to send an event as soon as they're activated
parents 36f822a4 92b56b8c
Loading
Loading
Loading
Loading
+8 −5
Original line number Diff line number Diff line
@@ -340,7 +340,9 @@ status_t SensorService::enable(const sp<SensorEventConnection>& connection,
            if (rec->addConnection(connection)) {
                // this sensor is already activated, but we are adding a
                // connection that uses it. Immediately send down the last
                // known value of the requested sensor.
                // known value of the requested sensor if it's not a
                // "continuous" sensor.
                if (sensor->getSensor().getMinDelay() == 0) {
                    sensors_event_t scratch;
                    sensors_event_t& event(mLastEventSeen.editValueFor(handle));
                    if (event.version == sizeof(sensors_event_t)) {
@@ -348,6 +350,7 @@ status_t SensorService::enable(const sp<SensorEventConnection>& connection,
                    }
                }
            }
        }
        if (err == NO_ERROR) {
            // connection now active
            if (connection->addSensor(handle)) {