[sensors] Add parameter check to poll()
Check maxCount parameter so that it will not allocate overly large
amount of memory if input parameter is bad.
Bug: 32953589
Test: build and pass vts
Change-Id: Ia19e0315ab1623b8b6580889c1e058a19e6c9670
diff --git a/sensors/1.0/ISensors.hal b/sensors/1.0/ISensors.hal
index c56da29..5c8301a 100644
--- a/sensors/1.0/ISensors.hal
+++ b/sensors/1.0/ISensors.hal
@@ -61,7 +61,9 @@
* If there is no sensor event when this function is being called, block
* until there are sensor events available.
*
- * @param maxCount max number of samples can be returned.
+ * @param maxCount max number of samples can be returned, must be > 0.
+ * Actual number of events returned in data must be <= maxCount
+ * and > 0.
* @return result OK on success or BAD_VALUE if maxCount <= 0.
* @return data vector of Event contains sensor events.
* @return dynamicSensorsAdded vector of SensorInfo contains dynamic sensor