[Internal: merge private->RSA , Patch create momanager.db]
[platform/core/system/sync-agent.git] / src / framework / event / oma_dm_noti_api.c
index 928b9d2..781089f 100755 (executable)
@@ -49,7 +49,7 @@ static int __over_big_size_noti_cb(sync_agent_event_data_s * request, void *data
 static int __low_battery_noti_cb(sync_agent_event_data_s * request, void *data);
 static int __default_noti_cb(sync_agent_event_data_s * request, void *data);
 
-static int _push_event_interface(sync_agent_dm_event_e event_num, int user_data, char *server_id, char *session_id);
+static int _push_event_interface(sync_agent_dm_event_e event_num, int user_data, char *server_id, char *session_id, int triger_type);
 
 static int task_id = 0;
 
@@ -127,7 +127,7 @@ EXPORT_API sync_agent_dm_error_e sync_agent_dm_push_deinit()
        return result;
 }
 
-EXPORT_API sync_agent_dm_error_e sync_agent_dm_fota_update_noti(char *server_id, char *session_id)
+EXPORT_API sync_agent_dm_error_e sync_agent_dm_fota_update_noti(char *server_id, char *session_id, int triger_type)
 {
        _EXTERN_FUNC_ENTER;
 
@@ -135,7 +135,7 @@ EXPORT_API sync_agent_dm_error_e sync_agent_dm_fota_update_noti(char *server_id,
 
        sync_agent_dm_error_e result = UI_SYNC_AGENT_DM_SUCCESS;
 
-       if (_push_event_interface(EVENT_SOFTWARE_UPDATE, 0, server_id, session_id) != SYNC_AGENT_DM_API_RESULT_SUCCESS) {
+       if (_push_event_interface(EVENT_SOFTWARE_UPDATE, 0, server_id, session_id, triger_type) != SYNC_AGENT_DM_API_RESULT_SUCCESS) {
                _DEBUG_ERROR("_push_event_interface(event num : %d) failed !!", EVENT_SOFTWARE_UPDATE);
                result = UI_SYNC_AGENT_DM_FAIL;
        } else {
@@ -153,7 +153,7 @@ EXPORT_API sync_agent_dm_error_e sync_agent_dm_fota_cancel_noti()
 
        sync_agent_dm_error_e result = UI_SYNC_AGENT_DM_SUCCESS;
 
-       if (_push_event_interface(EVENT_CANCEL, 0, NULL, NULL) != SYNC_AGENT_DM_API_RESULT_SUCCESS) {
+       if (_push_event_interface(EVENT_CANCEL, 0, NULL, NULL, 0) != SYNC_AGENT_DM_API_RESULT_SUCCESS) {
                _DEBUG_ERROR("_push_event_interface(event num : %d) failed !!", EVENT_CANCEL);
                result = UI_SYNC_AGENT_DM_FAIL;
        } else {
@@ -171,7 +171,7 @@ EXPORT_API sync_agent_dm_error_e sync_agent_dm_fota_download_noti(int response_t
 
        sync_agent_dm_error_e result = UI_SYNC_AGENT_DM_SUCCESS;
 
-       if (_push_event_interface(EVENT_DOWNLOAD, response_type, NULL, NULL) != SYNC_AGENT_DM_API_RESULT_SUCCESS) {
+       if (_push_event_interface(EVENT_DOWNLOAD, response_type, NULL, NULL, 0) != SYNC_AGENT_DM_API_RESULT_SUCCESS) {
                _DEBUG_ERROR("_push_event_interface(event num : %d) failed !!", EVENT_DOWNLOAD);
                result = UI_SYNC_AGENT_DM_FAIL;
        } else {
@@ -189,7 +189,7 @@ EXPORT_API sync_agent_dm_error_e sync_agent_dm_fota_install_noti(int response_ty
 
        sync_agent_dm_error_e result = UI_SYNC_AGENT_DM_SUCCESS;
 
-       if (_push_event_interface(EVENT_INSTALL, response_type, NULL, NULL) != SYNC_AGENT_DM_API_RESULT_SUCCESS) {
+       if (_push_event_interface(EVENT_INSTALL, response_type, NULL, NULL, 0) != SYNC_AGENT_DM_API_RESULT_SUCCESS) {
                _DEBUG_ERROR("_push_event_interface(event num : %d) failed !!", EVENT_INSTALL);
                result = UI_SYNC_AGENT_DM_FAIL;
        } else {
@@ -207,7 +207,7 @@ EXPORT_API sync_agent_dm_error_e sync_agent_dm_fota_set_interval_noti(int interv
 
        sync_agent_dm_error_e result = UI_SYNC_AGENT_DM_SUCCESS;
 
-       if (_push_event_interface(EVENT_SET_INTERVAL, interval_type, NULL, NULL) != SYNC_AGENT_DM_API_RESULT_SUCCESS) {
+       if (_push_event_interface(EVENT_SET_INTERVAL, interval_type, NULL, NULL, 0) != SYNC_AGENT_DM_API_RESULT_SUCCESS) {
                _DEBUG_ERROR("_push_event_interface(event num : %d) failed !!", EVENT_SET_INTERVAL);
                result = UI_SYNC_AGENT_DM_FAIL;
        } else {
@@ -443,7 +443,7 @@ static int __default_noti_cb(sync_agent_event_data_s * request, void *data)
        return 0;
 }
 
-static int _push_event_interface(sync_agent_dm_event_e event_num, int user_data, char *server_id, char *session_id)
+static int _push_event_interface(sync_agent_dm_event_e event_num, int user_data, char *server_id, char *session_id, int triger_type)
 {
        _EXTERN_FUNC_ENTER;
 
@@ -461,34 +461,38 @@ static int _push_event_interface(sync_agent_dm_event_e event_num, int user_data,
                return SYNC_AGENT_DM_API_RESULT_FAILURE;
        }
 
-       _DEBUG_VERBOSE("event num : %d", event_num);
+       _DEBUG_INFO("event num : %d", event_num);
 
        switch (event_num) {
        case EVENT_SOFTWARE_UPDATE:
                {
                        sync_agent_dm_ui_type_e ui_type = FOTA_NOTI_UI;
+                       /*Event_Type real_triger_type = triger_type;*/
+                       int real_triger_type = triger_type;
                        real_session_id = strdup(session_id);
                        real_server_id = strdup(server_id);
                        sync_agent_append_event_data_param(request_event, SYNC_AGENT_EVENT_PARAM_TYPE_INTEGER, &ui_type);
                        sync_agent_append_event_data_param(request_event, SYNC_AGENT_EVENT_PARAM_TYPE_STRING, real_session_id);
                        sync_agent_append_event_data_param(request_event, SYNC_AGENT_EVENT_PARAM_TYPE_STRING, real_server_id);
+                       sync_agent_append_event_data_param(request_event, SYNC_AGENT_EVENT_PARAM_TYPE_INTEGER, &real_triger_type);
 
-                       _DEBUG_VERBOSE("ui_type : FOTA_NOTI_UI");
-                       _DEBUG_VERBOSE("SESSION_ID : %s", real_session_id);
-                       _DEBUG_VERBOSE("SERVER_ID : %s", real_server_id);
+                       _DEBUG_INFO("ui_type : FOTA_NOTI_UI");
+                       _DEBUG_INFO("SESSION_ID : %s", real_session_id);
+                       _DEBUG_INFO("SERVER_ID : %s", real_server_id);
+                       _DEBUG_INFO("triger_type : %d", real_triger_type);
                }
                break;
        case EVENT_CANCEL:
                sync_agent_append_event_data_param(request_event, SYNC_AGENT_EVENT_PARAM_TYPE_INTEGER, &task_id);
 
-               _DEBUG_VERBOSE("task_id : %d", task_id);
+               _DEBUG_INFO("task_id : %d", task_id);
                break;
        case EVENT_DOWNLOAD:
        case EVENT_INSTALL:
        case EVENT_SET_INTERVAL:
                sync_agent_append_event_data_param(request_event, SYNC_AGENT_EVENT_PARAM_TYPE_INTEGER, &user_data);
 
-               _DEBUG_VERBOSE("user_data : %d", user_data);
+               _DEBUG_INFO("user_data : %d", user_data);
                break;
        default:
                break;
@@ -518,7 +522,7 @@ static int _push_event_interface(sync_agent_dm_event_e event_num, int user_data,
                return SYNC_AGENT_DM_API_RESULT_FAILURE;
        }
 
-       _DEBUG_VERBOSE("api_result : %d", api_result);
+       _DEBUG_INFO("api_result : %d", api_result);
 
        /* free request & response event */
        if (event_num == EVENT_SOFTWARE_UPDATE) {