Fix for ua_foreach_service 26/258426/3
authorrohit singh <rohit.singh@samsung.com>
Mon, 17 May 2021 12:03:19 +0000 (17:33 +0530)
committerAnupam Roy <anupam.r@samsung.com>
Tue, 25 May 2021 13:25:26 +0000 (13:25 +0000)
Issue: In a scenario when a service is registered and when
ua_foreach_service() is called it failed to get the newly registered
services though the service got persisted to db.

Solution: Logical error fix w.r.t app_num attribute of struct
uam_service_info_s at the daemon side solved the issue.

Change-Id: I055779441191e9439e66ab715c173f91c16b2817

ua-daemon/src/ua-manager-request-handler.c

index c1728be..dea0cad 100755 (executable)
@@ -927,10 +927,12 @@ static int __uam_manager_sync_request_handler(
        }
        case UAM_REQUEST_REGISTER_SERVICE: {
                uam_service_info_s svc;
-               svc.app_num = app_num;
 
                __uam_manager_copy_params(in_param1,
                                &svc, sizeof(uam_service_info_s));
+
+               svc.app_num = app_num;
+
                UAM_DBG("Name: [%s] Threshold presence: [%d] absence: [%d]",
                                svc.name, svc.presence_threshold, svc.absence_threshold);
                result = _uam_core_register_service(&svc, app_num);
@@ -939,10 +941,12 @@ static int __uam_manager_sync_request_handler(
        }
        case UAM_REQUEST_UPDATE_SERVICE: {
                uam_service_info_s svc;
-               svc.app_num = app_num;
 
                __uam_manager_copy_params(in_param1,
                                &svc, sizeof(uam_service_info_s));
+
+               svc.app_num = app_num;
+
                UAM_DBG("Name: [%s] Threshold presence: [%d] absence: [%d]",
                                svc.name, svc.presence_threshold, svc.absence_threshold);