sensord: remove termination routine when there is no sensor 61/135561/2
authorkibak.yoon <kibak.yoon@samsung.com>
Fri, 23 Jun 2017 05:44:27 +0000 (14:44 +0900)
committerkibak.yoon <kibak.yoon@samsung.com>
Fri, 23 Jun 2017 06:05:13 +0000 (15:05 +0900)
- serveral frameworks try to connect sensor continuously, so the sensor
  daemon runs every time they try. it's a overhead work.

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

index a7a2f03..22b3987 100644 (file)
@@ -33,7 +33,6 @@
 #define SET_CAL 1
 //#define CAL_NODE_PATH "/sys/class/sensors/ssp_sensor/set_cal_data"
 
-#define TIMEOUT_TERM 10
 #define MAX_CONNECTION 1000
 
 using namespace sensor;
@@ -87,7 +86,6 @@ bool server::init(void)
 
        init_calibration();
        init_server();
-       init_termination();
 
        is_running.store(true);
        sd_notify(0, "READY=1");
@@ -148,21 +146,3 @@ void server::init_server(void)
        m_server->set_option(SO_TYPE, SOCK_STREAM);
        m_server->bind(m_handler, &m_loop);
 }
-
-static gboolean terminate(gpointer data)
-{
-       sensor_manager *mgr = reinterpret_cast<sensor_manager *>(data);
-       std::vector<sensor_handler *> sensors = mgr->get_sensors();
-
-       if (sensors.size() <= 0) {
-               _I("Terminating.. because there is no sensors");
-               server::stop();
-       }
-
-       return FALSE;
-}
-
-void server::init_termination(void)
-{
-       g_timeout_add_seconds(TIMEOUT_TERM, terminate, m_manager);
-}
index 99856a1..e8a5771 100644 (file)
@@ -46,7 +46,6 @@ private:
 
        void init_calibration(void);
        void init_server(void);
-       void init_termination(void);
 
        ipc::ipc_server *m_server;
        sensor_manager *m_manager;