Skip to content

Commit 393e2c1

Browse files
pixelflingerAndroid (Google) Code Review
authored andcommitted
Merge "SensorService now always clamps the requested rate" into ics-mr1
2 parents 3af8b88 + eed2373 commit 393e2c1

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

services/sensorservice/SensorService.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -478,8 +478,9 @@ status_t SensorService::setEventRate(const sp<SensorEventConnection>& connection
478478
if (ns < 0)
479479
return BAD_VALUE;
480480

481-
if (ns == 0) {
482-
ns = sensor->getSensor().getMinDelayNs();
481+
nsecs_t minDelayNs = sensor->getSensor().getMinDelayNs();
482+
if (ns < minDelayNs) {
483+
ns = minDelayNs;
483484
}
484485

485486
if (ns < MINIMUM_EVENTS_PERIOD)

0 commit comments

Comments
 (0)