int syncType = 0;
int interval = 0;
GList *categories = NULL;
- int accountId;
+ int accountId = 0;
- bool res;
- int result;
+ bool res = false;
+ int result = 0;
sync_agent_get_param_value(&(param_array[0]->param_value), SYNC_AGENT_EC_VALUE_TYPE_STRUCT, &profileName);
sync_agent_get_param_value(&(param_array[1]->param_value), SYNC_AGENT_EC_VALUE_TYPE_STRUCT, &addr);
res = add_profile(profileName, addr, id, password, syncMode, syncType, interval, categories, &accountId);
if (res == false) {
err = SYNC_AGENT_EC_TASK_ERROR_RUN_FAILED;
- result = 0;
- } else
- result = 1;
+ _DEBUG_ERROR("add_profile failed!!");
- sync_agent_set_param_value(&(param_array[8]->param_value), SYNC_AGENT_EC_VALUE_TYPE_INT, &result);
- sync_agent_set_param_value(&(param_array[9]->param_value), SYNC_AGENT_EC_VALUE_TYPE_INT, &accountId);
+ result = 0;
+ sync_agent_set_param_value(&(param_array[8]->param_value), SYNC_AGENT_EC_VALUE_TYPE_INT, &result);
+ sync_agent_set_param_value(&(param_array[9]->param_value), SYNC_AGENT_EC_VALUE_TYPE_INT, &accountId);
+ } else {
- /*step 2 : start refresh_from_service for added account */
- void *in_param_value_array[1] = { &accountId };
- int in_param_index_array[1] = { 0 };
- sync_agent_ec_value_type_e in_param_value_type_array[1] = { SYNC_AGENT_EC_VALUE_TYPE_INT };
- unsigned int request_msg_id = 0;
- sync_agent_request_async_task(EC_MSG_TYPE_SYNC_TASK_REFRESH_FROM_SERVICE, 0, 1, in_param_index_array, in_param_value_type_array, in_param_value_array, NULL, NULL, (int *)&request_msg_id);
+ result = 1;
+ sync_agent_set_param_value(&(param_array[8]->param_value), SYNC_AGENT_EC_VALUE_TYPE_INT, &result);
+ sync_agent_set_param_value(&(param_array[9]->param_value), SYNC_AGENT_EC_VALUE_TYPE_INT, &accountId);
+
+ /*step 2 : start refresh_from_service for added account */
+ void *in_param_value_array[1] = { &accountId };
+ int in_param_index_array[1] = { 0 };
+ sync_agent_ec_value_type_e in_param_value_type_array[1] = { SYNC_AGENT_EC_VALUE_TYPE_INT };
+ unsigned int request_msg_id = 0;
+ sync_agent_request_async_task(EC_MSG_TYPE_SYNC_TASK_REFRESH_FROM_SERVICE, 0, 1, in_param_index_array, in_param_value_type_array, in_param_value_array, NULL, NULL, (int *)&request_msg_id);
+ }
_EXTERN_FUNC_EXIT;
return err;
res = edit_profile(profile_id, profileName, addr, id, password, syncMode, syncType, interval, categories);
if (res == false) {
err = SYNC_AGENT_EC_TASK_ERROR_RUN_FAILED;
- _DEBUG_INFO("edit_profile failed!!");
+ _DEBUG_ERROR("edit_profile failed!!");
result = 0;
} else {
_DEBUG_INFO("edit_profile success!!");
res = delete_profiles(profiles);
if (res == 0) {
err = SYNC_AGENT_EC_TASK_ERROR_RUN_FAILED;
- _DEBUG_INFO("delete_profiles failed!!");
+ _DEBUG_ERROR("delete_profiles failed!!");
result = 0;
} else {
_DEBUG_INFO("delete_profiles success!!");
int sync_mode = 0;
int syncType = 0;
int interval = 0;
- int lastSessionStatus;
- int lastSessionTime;
- int result;
- bool res;
+ int lastSessionStatus = 0;
+ int lastSessionTime = 0;
+ int result = 0;
+ bool res = false;
sync_agent_get_param_value(&(param_array[0]->param_value), SYNC_AGENT_EC_VALUE_TYPE_INT, &accountId);
retvm_if(accountId < 1, SYNC_AGENT_EC_TASK_ERROR_RUN_FAILED, "account id = %d", accountId);
res = get_profile_data(accountId, &profile_dir_name, &profileName, &addr, &id, &password, &sync_mode, &syncType, &interval, &lastSessionStatus, &lastSessionTime);
if (res == false) {
err = SYNC_AGENT_EC_TASK_ERROR_RUN_FAILED;
+ _DEBUG_ERROR("get_profile_data failed!!");
result = 0;
} else
result = 1;
sync_agent_ec_task_error_e err = SYNC_AGENT_EC_TASK_ERROR_RUN_SUCCESS;
int accountId = 0;
- int contentType;
+ int contentType = 0;
int enabled = 0;
int srcURI = 0;
char *tgtURI = NULL;
char *id = NULL;
char *password = NULL;
- bool res;
+ bool res = false;
int result = 0;
sync_agent_get_param_value(&(param_array[0]->param_value), SYNC_AGENT_EC_VALUE_TYPE_INT, &accountId);
res = get_profile_sync_category(accountId, contentType, &enabled, &srcURI, &tgtURI, &id, &password);
if (res == false) {
err = SYNC_AGENT_EC_TASK_ERROR_RUN_FAILED;
+ _DEBUG_ERROR("get_profile_sync_category failed!!");
result = 0;
} else
result = 1;
sync_agent_ec_task_error_e err = SYNC_AGENT_EC_TASK_ERROR_RUN_SUCCESS;
int accountId = 0;
- int contentType;
+ int contentType = 0;
char *dbSynced = NULL;
int lastSessionTime = -1;
int client2Server_NrOfDelete = 0;
int client2Server_NrOfReplace = 0;
- bool res;
- int result;
+ bool res = false;
+ int result = 0;
sync_agent_get_param_value(&(param_array[0]->param_value), SYNC_AGENT_EC_VALUE_TYPE_INT, &accountId);
retvm_if(accountId < 0, SYNC_AGENT_EC_TASK_ERROR_RUN_FAILED, "account id = %d", accountId);
if (res == false) {
err = SYNC_AGENT_EC_TASK_ERROR_RUN_FAILED;
+ _DEBUG_ERROR("get_profile_statistics failed!!");
result = 0;
} else
result = 1;
char *id = NULL;
char *password = NULL;
GList *categories = NULL;
- int accountId;
+ int accountId = 0;
- bool res;
- int result;
+ bool res = false;
+ int result = 0;
sync_agent_get_param_value(&(param_array[0]->param_value), SYNC_AGENT_EC_VALUE_TYPE_STRUCT, &profileName);
sync_agent_get_param_value(&(param_array[1]->param_value), SYNC_AGENT_EC_VALUE_TYPE_STRUCT, &addr);
res = add_profile_cp(profileName, addr, id, password, categories, &accountId);
if (res == false) {
err = SYNC_AGENT_EC_TASK_ERROR_RUN_FAILED;
+ _DEBUG_ERROR("add_profile_cp failed!!");
result = 0;
} else
result = 1;
sync_agent_ec_task_error_e err = SYNC_AGENT_EC_TASK_ERROR_RUN_SUCCESS;
- int accountId;
- bool res;
+ int accountId = 0;
+ bool res = false;
sync_agent_get_param_value(&(param_array[0]->param_value), SYNC_AGENT_EC_VALUE_TYPE_INT, &accountId);
res = refresh_from_service_all(accountId);
- if (res == false)
+ if (res == false) {
err = SYNC_AGENT_EC_TASK_ERROR_RUN_FAILED;
+ _DEBUG_ERROR("refresh_from_service_all failed!!");
+ }
_EXTERN_FUNC_EXIT;
return err;
sync_agent_ec_task_error_e err = SYNC_AGENT_EC_TASK_ERROR_RUN_SUCCESS;
- bool res;
- int result;
+ bool res = false;
+ int result = 0;
GList *profiles_data = NULL;
res = get_all_profiles_data(&profiles_data);
if (res == false) {
err = SYNC_AGENT_EC_TASK_ERROR_RUN_FAILED;
+ _DEBUG_ERROR("get_all_profiles_data failed!!");
result = 0;
} else
result = 1;
if (strcmp(src_uri,DEFINE_SOURCE_CONTACT_URI) == 0) {
src_uri_value = SRC_URI_CONTACT;
- } else if (strcmp(src_uri,DEFINE_SOURCE_CALENDAR_URI)) {
+ } else if (strcmp(src_uri,DEFINE_SOURCE_CALENDAR_URI) == 0) {
src_uri_value = SRC_URI_CALENDAR;
- } else if (strcmp(src_uri,DEFINE_SOURCE_MEMO_URI)) {
+ } else if (strcmp(src_uri,DEFINE_SOURCE_MEMO_URI) == 0) {
src_uri_value = SRC_URI_MEMO;
- } else if (strcmp(src_uri,DEFINE_SOURCE_CALLLOG_URI)) {
+ } else if (strcmp(src_uri,DEFINE_SOURCE_CALLLOG_URI) == 0) {
src_uri_value = SRC_URI_CALLLOG;
} else {
_DEBUG_ERROR("src_uri is invalid!!");
char *profileDirName = NULL;
se_error_type_e err = SE_INTERNAL_OK;
bool result;
- int sync_type_value = 0;
result = get_config(account_id, DEFINE_CONFIG_KEY_PROFILE_DIR_NAME, &profileDirName);
if (result == false) {
goto error;
}
- sync_type_value = __convert_alert_to_sync_type_value(server_sync_type);
- _DEBUG_INFO("sync_type_value: [%d]", sync_type_value);
-
if (profileDirName != NULL) {
- err = session_process(profileDirName, sync_type_value, process, error);
+ _DEBUG_INFO("profileDirName: [%s]", profileDirName);
+ err = session_process(profileDirName, server_sync_type, process, error);
if (err != SE_INTERNAL_OK) {
_DEBUG_ERROR("failed to send noti");
goto error;
{
_INNER_FUNC_ENTER;
+ if (account_id < 1){
+ _DEBUG_ERROR("account_id is invalid!!");
+ return SE_INTERNAL_ERROR;
+ } else {
+ _DEBUG_INFO("account_id: [%d]", account_id);
+ }
+
se_error_type_e err = SE_INTERNAL_OK;
changed_datastore_s *pChangedDatastore = NULL;
sync_agent_da_return_e da_err = SYNC_AGENT_DA_SUCCESS;
{
_EXTERN_FUNC_ENTER;
- _DEBUG_INFO("accountID = %d", account_id);
+ if (account_id < 1) {
+ _DEBUG_ERROR("account_id is invalid!!");
+ return false;
+ }
+
+ _DEBUG_INFO("account_id = %d", account_id);
_DEBUG_INFO("sync_mode = %s", sync_mode);
/*FIXME remove msg file */
{
_EXTERN_FUNC_ENTER;
+ if (account_id < 1) {\r
+ _DEBUG_ERROR("account_id is invalid!!");
+ return false;
+ } else {
+ _DEBUG_INFO("account_id: [%d]", account_id);
+ }
+
se_error_type_e err = SE_INTERNAL_OK;
sync_agent_da_return_e da_err = sync_agent_open_agent();