Merge "SensorService now always clamps the requested rate" into ics-mr1
This commit is contained in:
committed by
Android (Google) Code Review
commit
393e2c1f7a
@@ -478,8 +478,9 @@ status_t SensorService::setEventRate(const sp<SensorEventConnection>& connection
|
|||||||
if (ns < 0)
|
if (ns < 0)
|
||||||
return BAD_VALUE;
|
return BAD_VALUE;
|
||||||
|
|
||||||
if (ns == 0) {
|
nsecs_t minDelayNs = sensor->getSensor().getMinDelayNs();
|
||||||
ns = sensor->getSensor().getMinDelayNs();
|
if (ns < minDelayNs) {
|
||||||
|
ns = minDelayNs;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ns < MINIMUM_EVENTS_PERIOD)
|
if (ns < MINIMUM_EVENTS_PERIOD)
|
||||||
|
|||||||
Reference in New Issue
Block a user