sensord: set to UINT_MAX batch count when there is no batch latency for sensor 02/75602/1
authorkibak.yoon <kibak.yoon@samsung.com>
Tue, 7 Jun 2016 05:02:41 +0000 (14:02 +0900)
committerkibak.yoon <kibak.yoon@samsung.com>
Mon, 20 Jun 2016 13:31:34 +0000 (22:31 +0900)
- if there is no client which uses batch latency, batch count should be set
  the default value, not 0 but max batch count. if sensord sets the
  UINT_MAX as a default value, HAL will set the proper value comparing
  between this sensor's max batch count and UINT_MAX.

Change-Id: I3aff8d24c00ca6b232d33c803b1783cb60325abb
Signed-off-by: kibak.yoon <kibak.yoon@samsung.com>
src/server/sensor_base.cpp

index 5ff2566..a5a40bb 100644 (file)
@@ -18,6 +18,7 @@
  */
 
 #include <stdint.h>
+#include <limits.h>
 #include <sensor_hal_types.h>
 #include <sensor_event_queue.h>
 #include <sensor_base.h>
@@ -264,10 +265,10 @@ bool sensor_base::delete_batch(int client_id)
        cur_max = m_sensor_info_list.get_max_batch();
 
        if (!cur_max) {
-               _I("No latency for sensor[%#llx] by client[%d] deleting latency, so set to default 0 ms",
+               _I("No latency for sensor[%#llx] by client[%d] deleting latency, so set to default count",
                         get_id(), client_id);
 
-               set_batch_latency(0);
+               set_batch_latency(UINT_MAX);
        } else if (cur_max != prev_max) {
                _I("Max latency for sensor[%#llx] is changed from %dms to %dms by client[%d] deleting latency",
                        get_id(), prev_max, cur_max, client_id);