summaryrefslogtreecommitdiff
path: root/src/agent/service-engine/se_account.c
diff options
context:
space:
mode:
authorsanghyuk Ko <sanghyuk.ko@samsung.com>2013-03-20 17:35:56 +0900
committersanghyuk Ko <sanghyuk.ko@samsung.com>2013-03-20 17:35:56 +0900
commitbbae7d1b2a06e46d75c6673b2c67badee42bbdd7 (patch)
tree703bd1a017de95aaf702cc1eb229779febfccfd0 /src/agent/service-engine/se_account.c
parent2928ee51d097094087c5a6445bea90840f6f1db6 (diff)
downloadoma-ds-agent-bbae7d1b2a06e46d75c6673b2c67badee42bbdd7.tar.gz
oma-ds-agent-bbae7d1b2a06e46d75c6673b2c67badee42bbdd7.tar.bz2
oma-ds-agent-bbae7d1b2a06e46d75c6673b2c67badee42bbdd7.zip
[Internal: API change] When profile gets, input param changed.
[Problem] - [Cause] - [Solution] - When profile gets, input param changed. Change-Id: Ia6bd333d985c7a400b630cc7d069ad4d5ff56d44
Diffstat (limited to 'src/agent/service-engine/se_account.c')
-rwxr-xr-xsrc/agent/service-engine/se_account.c65
1 files changed, 21 insertions, 44 deletions
diff --git a/src/agent/service-engine/se_account.c b/src/agent/service-engine/se_account.c
index b1608d8..474672a 100755
--- a/src/agent/service-engine/se_account.c
+++ b/src/agent/service-engine/se_account.c
@@ -221,7 +221,7 @@ static se_error_type_e _add_profile(char *addr, char *id, char *password, char *
sync_agent_acc_error_e account_err = SYNC_AGENT_ACC_SUCCESS;
sync_agent_fw_account_s *fw_account = NULL;
- int account;
+ int account = -1;
char *folderID = NULL;
account_err = sync_agent_create_fw_account(&fw_account);
@@ -341,6 +341,7 @@ static se_error_type_e _add_profile(char *addr, char *id, char *password, char *
new_folder_id = NULL;
}
+ // call log folder ID
folderID = sync_agent_generate_folder_luid();
if (folderID == NULL) {
_DEBUG_ERROR("failed in sync_agent_generate_folder_luid");
@@ -356,7 +357,7 @@ static se_error_type_e _add_profile(char *addr, char *id, char *password, char *
folder->account_id = account;
folder->folder_id = strdup(folderID);
- folder->data_store_id = TYPE_MEMO;
+ folder->data_store_id = TYPE_CALLLOG;
folder->folder_type_id = 0; /* Default contacts folder */
folder->parent_folder_id = NULL;
folder->service_id = strdup("0");
@@ -385,40 +386,9 @@ static se_error_type_e _add_profile(char *addr, char *id, char *password, char *
new_folder_id = NULL;
}
- /* call log folder ID */
- folderID = sync_agent_generate_folder_luid();
- if (folderID == NULL) {
- _DEBUG_ERROR("failed in sync_agent_generate_folder_luid");
- err = SE_INTERNAL_DA_ERROR;
- goto error;
- }
-
- ret = sync_agent_create_folder(&folder);
- if (ret != SYNC_AGENT_DA_SUCCESS) {
- _DEBUG_ERROR("sync_agent_create_folder() failed !!");
- goto error;
- }
-
- folder->account_id = account;
- folder->folder_id = strdup(folderID);
- folder->data_store_id = TYPE_CALLLOG;
- folder->folder_type_id = 0; /* Default contacts folder */
- folder->parent_folder_id = NULL;
- folder->service_id = strdup("0");
- folder->access_name = strdup("EventHandler");
-
- ret = sync_agent_add_folder(folder, &new_folder_id);
- sync_agent_free_folder(folder);
- folder = NULL;
-
- if (ret != SYNC_AGENT_DA_SUCCESS) {
- _DEBUG_ERROR("Agent Add_Folder Failed_In sync_agent_add_account()!");
- _DEBUG_ERROR("[process_Event_Add_Account] Agent Add_Folder Failed_In sync_agent_add_account()!");
- err = SE_INTERNAL_ERROR;
- goto error;
- }
+ *account_id = account;
- _DEBUG_TRACE("[process_Event_Add_Account] Successed Agent Add_Folder in sync_agent_add_account(), added Folder ID : %s", new_folder_id);
+ error:
if (folderID != NULL) {
free(folderID);
@@ -430,13 +400,6 @@ static se_error_type_e _add_profile(char *addr, char *id, char *password, char *
new_folder_id = NULL;
}
- *account_id = account;
-
- error:
-
- if (folderID != NULL)
- free(folderID);
-
sync_agent_free_fw_account(fw_account);
_INNER_FUNC_EXIT;
@@ -635,7 +598,11 @@ static se_error_type_e _set_periodic_sync_config(int account_id, char *sync_mode
alarm_info->start_alarm_time = g_strdup_printf("%.2d-%.2d-%.2dT%.2d:%.2d:%.2dZ", struct_time->tm_year + 1900, struct_time->tm_mon + 1, struct_time->tm_mday, struct_time->tm_hour, struct_time->tm_min, struct_time->tm_sec);
alarm_info->is_disposable = 0;
- if (strcmp(interval, "5 minutes") == 0) {
+ if (strcmp(interval, "None") == 0) {
+ _DEBUG_ERROR("interval is none!!");
+ err = SE_INTERNAL_DA_ERROR;
+ goto error;
+ } else if (strcmp(interval, "5 minutes") == 0) {
_DEBUG_TRACE("5 minutes");
alarm_info->repeat_type = REPEAT;
alarm_info->repeat_value = 5 * 60;
@@ -720,6 +687,15 @@ static se_error_type_e _set_profile_info_into_config_list(int account_id, char *
se_error_type_e err = SE_INTERNAL_OK;
bool result;
+ char *account_id_str = NULL;
+
+ account_id_str = g_strdup_printf("%u", account_id);
+ result = ___append_config_value(account_id, DEFINE_CONFIG_KEY_PROFILE_ID, account_id_str, "int", "SE", config_list);
+ if (result == false) {
+ _DEBUG_ERROR("failed in _append_config_value");
+ err = SE_INTERNAL_DA_ERROR;
+ goto error;
+ }
result = ___append_config_value(account_id, DEFINE_CONFIG_KEY_PROFILE_DIR_NAME, profile_dir_name, "string", "SE", config_list);
if (result == false) {
@@ -763,7 +739,8 @@ static se_error_type_e _set_profile_info_into_config_list(int account_id, char *
goto error;
}
- result = ___append_config_value(account_id, DEFINE_CONFIG_KEY_PROFILE_SYNC_INTERVAL, interval != NULL ? interval : "5 minutes", "string", "SE", config_list);
+ //result = ___append_config_value(account_id, DEFINE_CONFIG_KEY_PROFILE_SYNC_INTERVAL, interval != NULL ? interval : "5 minutes", "string", "SE", config_list);
+ result = ___append_config_value(account_id, DEFINE_CONFIG_KEY_PROFILE_SYNC_INTERVAL, interval, "string", "SE", config_list);
if (result == false) {
_DEBUG_ERROR("failed in _append_config_value");
err = SE_INTERNAL_DA_ERROR;