Reduce calls to _uam_get_timestamp() accepted/tizen/unified/20191119.133204 submit/tizen/20191119.082254
authorLokesh <l.kasana@samsung.com>
Tue, 19 Nov 2019 05:36:17 +0000 (11:06 +0530)
committersaerome.kim <saerome.kim@samsung.com>
Tue, 19 Nov 2019 07:37:57 +0000 (16:37 +0900)
Instead use the value stored in tech->timestamp

Change-Id: I1017043c45a0fd53cd2f962c6168a1e7a902c7d2
Signed-off-by: Lokesh <l.kasana@samsung.com>
ua-daemon/src/ua-manager-core.c

index a36ea54..d1ae3d8 100644 (file)
@@ -2345,8 +2345,8 @@ int _uam_core_init(void)
                for (l = db_svc_dev_list; NULL != l; l = g_slist_next(l)) {
                        db_svc_dev_info_t *db_svc = l->data;
 
-                       _uam_core_update_svc_dev_info((char *)&(db_svc->device_id), db_svc->type,
-                               (char *)&(db_svc->svc), db_svc->discriminant);
+                       _uam_core_update_svc_dev_info(db_svc->device_id, db_svc->type,
+                                       db_svc->svc, db_svc->discriminant);
                }
        }
 
@@ -2727,6 +2727,8 @@ void __send_user_presence_event(uam_db_tech_info_t *tech, unsigned int sensor,
        ret_if(NULL == tech->svc_list);
 
        user = tech->device->user;
+       user->timestamp = tech->timestamp;
+
        for (l = tech->svc_list; NULL != l; l = g_slist_next(l)) {
                uam_db_service_info_t *svc = l->data;
                GSList *l1;
@@ -2764,8 +2766,6 @@ void __send_user_presence_event(uam_db_tech_info_t *tech, unsigned int sensor,
                         */
                        live_monitoring = TRUE;
 
-                       user->timestamp = _uam_get_timestamp();
-
                        UAM_INFO("sensor [%d]", sensor);
                        _uam_manager_send_event(mon->name,
                                        UAM_EVENT_USER_PRESENCE_DETECTED,
@@ -2781,7 +2781,7 @@ void __send_user_presence_event(uam_db_tech_info_t *tech, unsigned int sensor,
                }
 
                if (live_monitoring)
-                       svc_dev->timestamp = _uam_get_timestamp();
+                       svc_dev->timestamp = tech->timestamp;
        }
 
        FUNC_EXIT;