diff options
author | Mathias Agopian <mathias@google.com> | 2011-03-10 17:36:15 -0800 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2011-03-10 17:36:15 -0800 |
commit | e90c4998b514f738b3655e55b51a38119b8c5f23 (patch) | |
tree | aca81a9a1926f3a17215df8b240a40484463e354 | |
parent | 2fc7976399e5f0f4c6e1dae528df727e7dcbdc8e (diff) | |
parent | 8d94d82a6dcf987edec0cf642a4d21b8a367550c (diff) |
Merge "fix [4025681] continuous sensors should not try to send an event as soon as they're activated" into honeycomb-mr1
-rw-r--r-- | services/sensorservice/SensorService.cpp | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/services/sensorservice/SensorService.cpp b/services/sensorservice/SensorService.cpp index 697e879207ec..ce1ab3df23d9 100644 --- a/services/sensorservice/SensorService.cpp +++ b/services/sensorservice/SensorService.cpp @@ -340,11 +340,14 @@ 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. - sensors_event_t scratch; - sensors_event_t& event(mLastEventSeen.editValueFor(handle)); - if (event.version == sizeof(sensors_event_t)) { - connection->sendEvents(&event, 1); + // 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)) { + connection->sendEvents(&event, 1); + } } } } |