Merge "SensorService now always clamps the requested rate" into ics-mr1
diff --git a/services/sensorservice/SensorService.cpp b/services/sensorservice/SensorService.cpp
index d2d2d8b..c2c6b4d 100644
--- a/services/sensorservice/SensorService.cpp
+++ b/services/sensorservice/SensorService.cpp
@@ -478,8 +478,9 @@
     if (ns < 0)
         return BAD_VALUE;
 
-    if (ns == 0) {
-        ns = sensor->getSensor().getMinDelayNs();
+    nsecs_t minDelayNs = sensor->getSensor().getMinDelayNs();
+    if (ns < minDelayNs) {
+        ns = minDelayNs;
     }
 
     if (ns < MINIMUM_EVENTS_PERIOD)