From b97d1b65964060682743ff1d3410bc92faf2921a Mon Sep 17 00:00:00 2001 From: "saerome.kim" Date: Thu, 21 Nov 2019 13:39:37 +0900 Subject: [PATCH] Change the last seen that has never been added or detected by the service to 0 - Problem: The last_seen information may not be 0 even if the service is not executed. - Cause: We are adding the last_seen info regardless the service. - Solution: The device information added to the service is initialized to 0. Change-Id: I14249599db420b25e47098c83eaa17ed1d65182e Signed-off-by: Lokesh --- ua-daemon/src/ua-manager-core.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ua-daemon/src/ua-manager-core.c b/ua-daemon/src/ua-manager-core.c index 2170cfc..94fa9a3 100644 --- a/ua-daemon/src/ua-manager-core.c +++ b/ua-daemon/src/ua-manager-core.c @@ -2587,7 +2587,7 @@ int _uam_core_handle_device_added(int status, /* Add device to database */ ret = _uam_device_db_insert_device_info(user->user_id, dev_info, - UAM_PRESENCE_STATE_PRESENT, 0); + UAM_PRESENCE_STATE_PRESENT, dev_info->last_seen); if (UAM_ERROR_NONE != ret) { UAM_WARN("Device addition to persistent DB failed"); __uam_db_end_transaction(0); @@ -2598,7 +2598,7 @@ int _uam_core_handle_device_added(int status, ret = _uam_db_insert_device_service_info( dev_info->device_id, dev_info->type, dev_info->mac, UAM_SERVICE_DEFAULT, UAM_DETECTION_CYCLE_DEFAULT, - dev_info->discriminant, dev_info->last_seen); + dev_info->discriminant, 0); if (UAM_ERROR_NONE != ret) { UAM_WARN("Device service addition to persistent DB failed"); __send_device_event(ret, UAM_EVENT_DEVICE_ADDED, dev_info); @@ -2608,7 +2608,7 @@ int _uam_core_handle_device_added(int status, __uam_db_end_transaction(1); ret = _uam_core_update_svc_dev_info(dev_info->device_id, dev_info->type, - UAM_SERVICE_DEFAULT, dev_info->discriminant, dev_info->last_seen); + UAM_SERVICE_DEFAULT, dev_info->discriminant, 0); if (UAM_ERROR_NONE != ret) { UAM_WARN("Device service mappiing update failed"); __send_device_event(ret, UAM_EVENT_DEVICE_ADDED, dev_info); -- 2.7.4