* if max_batch_count is 0, it means that batching feature is not supported on this
sensor. so checking max_batch_count is added.
Change-Id: I466b7406cdb5dfeeb584d0f23bbe8e6d2011ffcf
Signed-off-by: kibak.yoon <kibak.yoon@samsung.com>
{
int id;
int type;
+ int max_batch_count;
unsigned int event_id;
_D("called sensor_set_max_batch_latency : listener[0x%x], max_batch_latency[%d]", listener, max_batch_latency);
if (listener->magic != SENSOR_LISTENER_MAGIC)
return SENSOR_ERROR_INVALID_PARAMETER;
+ if (!sensord_get_max_batch_count(listener->sensor, &max_batch_count))
+ return SENSOR_ERROR_OPERATION_FAILED;
+
+ if (max_batch_count == 0)
+ return SENSOR_ERROR_NOT_SUPPORTED;
+
id = listener->id;
type = (int)listener->type;
event_id = type << SENSOR_SHIFT_TYPE | 0x1;