Merge "fix [4025681] continuous sensors should not try to send an event as soon as they're activated" into honeycomb-mr1
This commit is contained in:
committed by
Android (Google) Code Review
commit
e90c4998b5
@@ -340,11 +340,14 @@ status_t SensorService::enable(const sp<SensorEventConnection>& connection,
|
|||||||
if (rec->addConnection(connection)) {
|
if (rec->addConnection(connection)) {
|
||||||
// this sensor is already activated, but we are adding a
|
// this sensor is already activated, but we are adding a
|
||||||
// connection that uses it. Immediately send down the last
|
// 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
|
||||||
sensors_event_t scratch;
|
// "continuous" sensor.
|
||||||
sensors_event_t& event(mLastEventSeen.editValueFor(handle));
|
if (sensor->getSensor().getMinDelay() == 0) {
|
||||||
if (event.version == sizeof(sensors_event_t)) {
|
sensors_event_t scratch;
|
||||||
connection->sendEvents(&event, 1);
|
sensors_event_t& event(mLastEventSeen.editValueFor(handle));
|
||||||
|
if (event.version == sizeof(sensors_event_t)) {
|
||||||
|
connection->sendEvents(&event, 1);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user