From: sooyeon Date: Thu, 4 Aug 2022 04:42:54 +0000 (+0900) Subject: Change variable names and function names X-Git-Tag: submit/tizen/20220826.042422~8 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=d8d5d2c080de4c2d2c5cde429fc19a564fd74174;p=platform%2Fcore%2Fuifw%2Fvoice-control.git Change variable names and function names Change-Id: I3eea6c8094a1752911243ce8e9202ecf3b256ec4 Signed-off-by: sooyeon --- diff --git a/client/vc.c b/client/vc.c index 3d359bb..1c9b8b9 100644 --- a/client/vc.c +++ b/client/vc.c @@ -49,7 +49,7 @@ static Ecore_Event_Handler* g_focus_out_handler = NULL; static Ecore_Thread* g_tts_thread = NULL; -static unsigned int g_handle; +static int g_pid; static int g_daemon_pid = 0; @@ -231,10 +231,10 @@ static int __vc_convert_config_error_code(vc_config_error_e code) return VC_ERROR_NONE; } -static void __vc_lang_changed_cb(const char* before_lang, const char* current_lang) +static void __vc_lang_changed_cb(const char* previous_lang, const char* current_lang) { - SLOG(LOG_DEBUG, TAG_VCC, "Lang changed : Before lang(%s) Current lang(%s)", - before_lang, current_lang); + SLOG(LOG_DEBUG, TAG_VCC, "Lang changed : previous lang(%s) Current lang(%s)", + previous_lang, current_lang); vc_current_language_changed_cb callback; void* lang_user_data; @@ -242,7 +242,7 @@ static void __vc_lang_changed_cb(const char* before_lang, const char* current_la if (NULL != callback) { vc_client_use_callback(); - callback(before_lang, current_lang, lang_user_data); + callback(previous_lang, current_lang, lang_user_data); vc_client_not_use_callback(); SLOG(LOG_DEBUG, TAG_VCC, "Language changed callback is called"); } else { @@ -259,14 +259,14 @@ static Eina_Bool __notify_auth_changed_cb(void *data) vc_client_get_auth_state_changed_cb(&callback, &user_data); - vc_auth_state_e before = -1; + vc_auth_state_e previous = -1; vc_auth_state_e current = -1; - vc_client_get_before_auth_state(&before, ¤t); + vc_client_get_previous_auth_state(&previous, ¤t); if (NULL != callback) { vc_client_use_callback(); - callback(before, current, user_data); + callback(previous, current, user_data); vc_client_not_use_callback(); SLOG(LOG_DEBUG, TAG_VCC, "Auth state changed callback is called"); } else { @@ -362,8 +362,8 @@ int vc_initialize(void) return VC_ERROR_OUT_OF_MEMORY; //LCOV_EXCL_LINE } - g_handle = getpid(); - ret = vc_config_mgr_initialize(g_handle); + g_pid = getpid(); + ret = vc_config_mgr_initialize(g_pid); if (0 != ret) { SLOG(LOG_ERROR, TAG_VCC, "[ERROR] Fail to init config manager : %s", __vc_get_error_code(__vc_convert_config_error_code(ret))); //LCOV_EXCL_LINE @@ -371,15 +371,15 @@ int vc_initialize(void) return __vc_convert_config_error_code(ret); //LCOV_EXCL_LINE } - ret = vc_config_mgr_set_lang_cb(g_handle, __vc_lang_changed_cb); + ret = vc_config_mgr_set_lang_cb(g_pid, __vc_lang_changed_cb); if (0 != ret) { SLOG(LOG_ERROR, TAG_VCC, "[ERROR] Fail to set config changed : %d", ret); //LCOV_EXCL_LINE - vc_config_mgr_finalize(g_handle); //LCOV_EXCL_LINE + vc_config_mgr_finalize(g_pid); //LCOV_EXCL_LINE vc_client_destroy(); //LCOV_EXCL_LINE return __vc_convert_config_error_code(ret); } - SLOG(LOG_DEBUG, TAG_VCC, "[Success] pid(%d)", g_handle); + SLOG(LOG_DEBUG, TAG_VCC, "[Success] pid(%d)", g_pid); return VC_ERROR_NONE; @@ -399,7 +399,7 @@ static void __vc_internal_unprepare(void) } } - int ret = vc_tidl_request_finalize(g_handle); + int ret = vc_tidl_request_finalize(g_pid); if (0 != ret) { SLOG(LOG_ERROR, TAG_VCC, "[ERROR] Fail to request finalize : %s", __vc_get_error_code(ret)); //LCOV_EXCL_LINE } @@ -449,12 +449,12 @@ int vc_deinitialize(void) g_connect_timer = NULL; } - vc_config_mgr_unset_lang_cb(g_handle); - vc_config_mgr_finalize(g_handle); + vc_config_mgr_unset_lang_cb(g_pid); + vc_config_mgr_finalize(g_pid); /* Free client resources */ vc_client_destroy(); - g_handle = 0; + g_pid = 0; break; case VC_STATE_NONE: break; @@ -509,7 +509,7 @@ static Eina_Bool __vc_connect_daemon(void *data) if (0 != ret) SLOG(LOG_ERROR, TAG_VCC, "[ERROR] Fail to delete file, type(%d), ret(%d)", VC_COMMAND_TYPE_FOREGROUND, ret); //LCOV_EXCL_LINE - ret = vc_tidl_request_initialize(g_handle, &mgr_pid, &service_state, &g_daemon_pid); + ret = vc_tidl_request_initialize(g_pid, &mgr_pid, &service_state, &g_daemon_pid); //LCOV_EXCL_START if (VC_ERROR_ENGINE_NOT_FOUND == ret) { SLOG(LOG_ERROR, TAG_VCC, "[ERROR] Fail to initialize : %s", __vc_get_error_code(ret)); @@ -899,7 +899,7 @@ int vc_get_system_command_list(vc_cmd_list_h* vc_sys_cmd_list) ret = -1; bool is_prepared = false; do { - ret = vc_tidl_request_is_system_command_valid(g_handle, &is_sys_cmd_valid); + ret = vc_tidl_request_is_system_command_valid(g_pid, &is_sys_cmd_valid); if (0 != ret) { //LCOV_EXCL_START if (VC_ERROR_INVALID_PARAMETER == ret && false == is_prepared) { @@ -1083,7 +1083,7 @@ void __set_command(vc_cmd_type_e type) int count = 0; bool is_prepared = false; do { - ret = vc_tidl_request_set_command(g_handle, type); + ret = vc_tidl_request_set_command(g_pid, type); if (0 != ret) { //LCOV_EXCL_START if (VC_ERROR_INVALID_PARAMETER == ret && false == is_prepared) { @@ -1196,7 +1196,7 @@ int vc_unset_command_list(int type) ret = -1; bool is_prepared = false; while (0 != ret) { - ret = vc_tidl_request_unset_command(g_handle, (vc_cmd_type_e)type); + ret = vc_tidl_request_unset_command(g_pid, (vc_cmd_type_e)type); if (0 != ret) { //LCOV_EXCL_START if (VC_ERROR_INVALID_PARAMETER == ret && false == is_prepared) { @@ -1563,7 +1563,7 @@ static void __vc_notify_error(void *data) } } -int __vc_cb_error_to_app(int pid, int reason, const char* msg) +int __vc_cb_error(int reason, const char* msg) { if (VC_ERROR_SERVICE_RESET == reason) { SLOG(LOG_ERROR, TAG_VCC, "[ERROR] VC daemon reset"); @@ -1576,7 +1576,7 @@ int __vc_cb_error_to_app(int pid, int reason, const char* msg) } } - SLOG(LOG_ERROR, TAG_VCC, "[INFO] send error to app(%d), error reason(%d), msg(%s)", pid, reason, msg); + SLOG(LOG_ERROR, TAG_VCC, "[INFO] send error reason(%d), msg(%s)", reason, msg); vc_client_set_error(reason); ecore_main_loop_thread_safe_call_async(__vc_notify_error, NULL); @@ -1592,13 +1592,13 @@ static void __vc_notify_state_changed(void *data) vc_client_get_state_changed_cb(&changed_callback, &user_data); vc_state_e current_state; - vc_state_e before_state; + vc_state_e previous_state; - vc_client_get_before_state(¤t_state, &before_state); + vc_client_get_previous_state(¤t_state, &previous_state); if (NULL != changed_callback) { vc_client_use_callback(); - changed_callback(before_state, current_state, user_data); + changed_callback(previous_state, current_state, user_data); vc_client_not_use_callback(); SLOG(LOG_DEBUG, TAG_VCC, "State changed callback is called"); } else { @@ -1756,15 +1756,15 @@ int vc_unset_result_cb(void) int __vc_cb_service_state(int state) { vc_service_state_e current_state = (vc_service_state_e)state; - vc_service_state_e before_state; - vc_client_get_service_state(&before_state); + vc_service_state_e previous_state; + vc_client_get_service_state(&previous_state); - if (current_state == before_state) { + if (current_state == previous_state) { return VC_ERROR_NONE; } - SLOG(LOG_DEBUG, TAG_VCC, "Service State changed : Before(%d) Current(%d)", - before_state, current_state); + SLOG(LOG_DEBUG, TAG_VCC, "Service State changed : previous(%d) current(%d)", + previous_state, current_state); /* Save service state */ vc_client_set_service_state(current_state); @@ -1775,7 +1775,7 @@ int __vc_cb_service_state(int state) if (NULL != callback) { vc_client_use_callback(); - callback((vc_service_state_e)before_state, (vc_service_state_e)current_state, service_user_data); + callback((vc_service_state_e)previous_state, (vc_service_state_e)current_state, service_user_data); vc_client_not_use_callback(); SLOG(LOG_DEBUG, TAG_VCC, "Service state changed callback is called"); } else { @@ -2207,7 +2207,7 @@ int vc_auth_enable(void) return VC_ERROR_OPERATION_FAILED; } - if (0 != vc_tidl_request_auth_enable(g_handle, mgr_pid)) { + if (0 != vc_tidl_request_auth_enable(g_pid, mgr_pid)) { SLOG(LOG_ERROR, TAG_VCC, "[ERROR] Fail to authority enabled"); return VC_ERROR_OPERATION_FAILED; } @@ -2266,7 +2266,7 @@ int vc_auth_disable(void) return VC_ERROR_OPERATION_FAILED; } - if (0 != vc_tidl_request_auth_disable(g_handle, mgr_pid)) { + if (0 != vc_tidl_request_auth_disable(g_pid, mgr_pid)) { SLOG(LOG_ERROR, TAG_VCC, "[ERROR] Fail to authority disable"); return VC_ERROR_OPERATION_FAILED; } @@ -2394,7 +2394,7 @@ int vc_auth_start(void) bool is_prepared = false; /* Request */ while (0 != ret) { - ret = vc_tidl_request_auth_start(g_handle, mgr_pid); + ret = vc_tidl_request_auth_start(g_pid, mgr_pid); if (0 != ret) { if (VC_ERROR_INVALID_PARAMETER == ret && false == is_prepared) { vc_client_set_client_state(VC_STATE_INITIALIZED); @@ -2462,7 +2462,7 @@ int vc_auth_stop(void) bool is_prepared = false; /* do request */ while (0 != ret) { - ret = vc_tidl_request_auth_stop(g_handle, mgr_pid); + ret = vc_tidl_request_auth_stop(g_pid, mgr_pid); if (0 != ret) { if (VC_ERROR_INVALID_PARAMETER == ret && false == is_prepared) { vc_client_set_client_state(VC_STATE_INITIALIZED); @@ -2532,7 +2532,7 @@ int vc_auth_cancel(void) int count = 0; bool is_prepared = false; while (0 != ret) { - ret = vc_tidl_request_auth_cancel(g_handle, mgr_pid); + ret = vc_tidl_request_auth_cancel(g_pid, mgr_pid); if (0 != ret) { if (VC_ERROR_INVALID_PARAMETER == ret && false == is_prepared) { vc_client_set_client_state(VC_STATE_INITIALIZED); diff --git a/client/vc_client.c b/client/vc_client.c index eb2c11c..442ac1f 100644 --- a/client/vc_client.c +++ b/client/vc_client.c @@ -20,7 +20,6 @@ typedef struct { /* base info */ int pid; - unsigned int uid; /*<< unique id = pid + handle */ vc_result_cb result_cb; void* result_user_data; @@ -48,7 +47,7 @@ typedef struct { vc_service_state_e service_state; /* state */ - vc_state_e before_state; + vc_state_e previous_state; vc_state_e current_state; /* mutex */ @@ -58,7 +57,7 @@ typedef struct { int reason; /* Authority */ - vc_auth_state_e auth_before_state; + vc_auth_state_e auth_previous_state; vc_auth_state_e auth_current_state; vc_auth_state_changed_cb auth_state_changed_cb; void* auth_state_changed_user_data; @@ -90,7 +89,6 @@ int vc_client_create(void) /* initialize client data */ g_client->pid = getpid(); - g_client->uid = getpid(); g_client->result_cb = NULL; g_client->result_user_data = NULL; @@ -113,13 +111,13 @@ int vc_client_create(void) g_client->service_state = VC_RUNTIME_INFO_NO_FOREGROUND; - g_client->before_state = VC_STATE_INITIALIZED; + g_client->previous_state = VC_STATE_INITIALIZED; g_client->current_state = VC_STATE_INITIALIZED; g_client->cb_ref_count = 0; /* Authority */ - g_client->auth_before_state = VC_AUTH_STATE_NONE; + g_client->auth_previous_state = VC_AUTH_STATE_NONE; g_client->auth_current_state = VC_AUTH_STATE_NONE; g_client->auth_state_changed_cb = NULL; g_client->auth_state_changed_user_data = NULL; @@ -127,7 +125,7 @@ int vc_client_create(void) g_client->is_foreground = false; g_client->invocation_name = NULL; - SLOG(LOG_INFO, TAG_VCC, "[INFO] client create. uid(%u)", g_client->uid); + SLOG(LOG_INFO, TAG_VCC, "[INFO] client create. pid(%u)", g_client->pid); return VC_ERROR_NONE; } @@ -323,7 +321,7 @@ int vc_client_set_client_state(vc_state_e state) if (NULL == g_client) return VC_ERROR_INVALID_PARAMETER; - g_client->before_state = g_client->current_state; + g_client->previous_state = g_client->current_state; g_client->current_state = state; return VC_ERROR_NONE; @@ -340,13 +338,13 @@ int vc_client_get_client_state(vc_state_e* state) return VC_ERROR_NONE; } -int vc_client_get_before_state(vc_state_e* state, vc_state_e* before_state) +int vc_client_get_previous_state(vc_state_e* state, vc_state_e* previous_state) { /* check handle */ if (NULL == g_client) return VC_ERROR_INVALID_PARAMETER; - *before_state = g_client->before_state; + *previous_state = g_client->previous_state; *state = g_client->current_state; return VC_ERROR_NONE; @@ -519,7 +517,7 @@ int vc_client_set_auth_state(vc_auth_state_e state) if (NULL == g_client) return VC_ERROR_INVALID_PARAMETER; - g_client->auth_before_state = g_client->auth_current_state; + g_client->auth_previous_state = g_client->auth_current_state; g_client->auth_current_state = state; return VC_ERROR_NONE; @@ -536,13 +534,13 @@ int vc_client_get_auth_state(vc_auth_state_e* state) return VC_ERROR_NONE; } -int vc_client_get_before_auth_state(vc_auth_state_e* before, vc_auth_state_e* current) +int vc_client_get_previous_auth_state(vc_auth_state_e* previous, vc_auth_state_e* current) { /* check handle */ if (NULL == g_client) return VC_ERROR_INVALID_PARAMETER; - *before = g_client->auth_before_state; + *previous = g_client->auth_previous_state; *current = g_client->auth_current_state; return VC_ERROR_NONE; diff --git a/client/vc_client.h b/client/vc_client.h index f8946a0..21c3ea9 100644 --- a/client/vc_client.h +++ b/client/vc_client.h @@ -73,7 +73,7 @@ int vc_client_set_client_state(vc_state_e state); int vc_client_get_client_state(vc_state_e* state); -int vc_client_get_before_state(vc_state_e* state, vc_state_e* before_state); +int vc_client_get_previous_state(vc_state_e* state, vc_state_e* previous_state); int vc_client_set_invocation_name(const char* invocation_name); @@ -110,7 +110,7 @@ int vc_client_set_auth_state(vc_auth_state_e state); int vc_client_get_auth_state(vc_auth_state_e* state); -int vc_client_get_before_auth_state(vc_auth_state_e* before, vc_auth_state_e* current); +int vc_client_get_previous_auth_state(vc_auth_state_e* previous, vc_auth_state_e* current); int vc_client_set_mgr_pid(int mgr_pid); diff --git a/client/vc_mgr.c b/client/vc_mgr.c index fcc1c81..295fcf4 100644 --- a/client/vc_mgr.c +++ b/client/vc_mgr.c @@ -108,10 +108,10 @@ static const char* __vc_mgr_get_error_code(vc_error_e err) return NULL; } -static void __vc_mgr_lang_changed_cb(const char* before_lang, const char* current_lang) +static void __vc_mgr_lang_changed_cb(const char* previous_lang, const char* current_lang) { - SLOG(LOG_INFO, TAG_VCM, "Lang changed : Before lang(%s) Current lang(%s)", - before_lang, current_lang); + SLOG(LOG_INFO, TAG_VCM, "Lang changed : previous lang(%s) current lang(%s)", + previous_lang, current_lang); vc_current_language_changed_cb callback = NULL; void* lang_user_data; @@ -119,7 +119,7 @@ static void __vc_mgr_lang_changed_cb(const char* before_lang, const char* curren if (NULL != callback) { vc_mgr_client_use_callback(g_vc_m); - callback(before_lang, current_lang, lang_user_data); + callback(previous_lang, current_lang, lang_user_data); vc_mgr_client_not_use_callback(g_vc_m); SLOG(LOG_INFO, TAG_VCM, "Language changed callback is called"); } else { @@ -491,13 +491,13 @@ static Eina_Bool __request_initialize(void *data) vc_mgr_client_get_state_changed_cb(g_vc_m, &changed_callback, &user_data); vc_state_e current_state; - vc_state_e before_state; + vc_state_e previous_state; - vc_mgr_client_get_before_state(g_vc_m, ¤t_state, &before_state); + vc_mgr_client_get_previous_state(g_vc_m, ¤t_state, &previous_state); if (NULL != changed_callback) { vc_mgr_client_use_callback(g_vc_m); - changed_callback(before_state, current_state, user_data); + changed_callback(previous_state, current_state, user_data); vc_mgr_client_not_use_callback(g_vc_m); SLOG(LOG_INFO, TAG_VCM, "State changed callback is called"); } else { @@ -2401,13 +2401,13 @@ static Eina_Bool __vc_mgr_notify_state_changed(void *data) vc_mgr_client_get_state_changed_cb(g_vc_m, &changed_callback, &user_data); vc_state_e current_state; - vc_state_e before_state; + vc_state_e previous_state; - vc_mgr_client_get_before_state(g_vc_m, ¤t_state, &before_state); + vc_mgr_client_get_previous_state(g_vc_m, ¤t_state, &previous_state); if (NULL != changed_callback) { vc_mgr_client_use_callback(g_vc_m); - changed_callback(before_state, current_state, user_data); + changed_callback(previous_state, current_state, user_data); vc_mgr_client_not_use_callback(g_vc_m); SLOG(LOG_INFO, TAG_VCM, "State changed callback is called"); } else { @@ -2466,11 +2466,11 @@ int vc_mgr_unset_state_changed_cb(void) int __vc_mgr_cb_service_state(int state) { vc_service_state_e current_state = (vc_service_state_e)state; - vc_service_state_e before_state; - vc_mgr_client_get_service_state(g_vc_m, &before_state); + vc_service_state_e previous_state; + vc_mgr_client_get_service_state(g_vc_m, &previous_state); - SLOG(LOG_INFO, TAG_VCM, "Service State changed : Before(%d) Current(%d)", - before_state, current_state); + SLOG(LOG_INFO, TAG_VCM, "Service State changed : previous(%d) current(%d)", + previous_state, current_state); vc_internal_state_e internal_state = -1; vc_mgr_client_get_internal_state(g_vc_m, &internal_state); @@ -2485,9 +2485,9 @@ int __vc_mgr_cb_service_state(int state) vc_mgr_client_set_internal_state(g_vc_m, VC_INTERNAL_STATE_NONE); } - if (current_state == before_state) { - SLOG(LOG_WARN, TAG_VCM, "Service State NOT changed : Before(%d) Current(%d)", - before_state, current_state); + if (current_state == previous_state) { + SLOG(LOG_WARN, TAG_VCM, "Service State NOT changed : previous(%d) current(%d)", + previous_state, current_state); return VC_ERROR_NONE; } @@ -2500,7 +2500,7 @@ int __vc_mgr_cb_service_state(int state) if (NULL != callback) { vc_mgr_client_use_callback(g_vc_m); - callback(before_state, current_state, service_user_data); + callback(previous_state, current_state, service_user_data); vc_mgr_client_not_use_callback(g_vc_m); SLOG(LOG_INFO, TAG_VCM, "Service state changed callback is called"); } else { diff --git a/client/vc_mgr_client.c b/client/vc_mgr_client.c index 9da3025..f10480b 100644 --- a/client/vc_mgr_client.c +++ b/client/vc_mgr_client.c @@ -75,11 +75,11 @@ typedef struct { vc_internal_state_e internal_state; /* state */ - vc_state_e before_state; + vc_state_e previous_state; vc_state_e current_state; /* language */ - char* before_language; + char* previous_language; char* current_language; /* audio type */ @@ -212,10 +212,10 @@ int vc_mgr_client_create(vc_h* vc) client->internal_state = VC_INTERNAL_STATE_NONE; - client->before_state = VC_STATE_INITIALIZED; + client->previous_state = VC_STATE_INITIALIZED; client->current_state = VC_STATE_INITIALIZED; - client->before_language = NULL; + client->previous_language = NULL; client->current_language = NULL; client->audio_id = NULL; @@ -820,7 +820,7 @@ int vc_mgr_client_set_client_state(vc_h vc, vc_state_e state) if (NULL == client) return VC_ERROR_INVALID_PARAMETER; - client->before_state = client->current_state; + client->previous_state = client->current_state; client->current_state = state; return VC_ERROR_NONE; @@ -860,7 +860,7 @@ int vc_mgr_client_get_client_state_by_uid(unsigned int uid, vc_state_e* state) return VC_ERROR_INVALID_PARAMETER; } -int vc_mgr_client_get_before_state(vc_h vc, vc_state_e* state, vc_state_e* before_state) +int vc_mgr_client_get_previous_state(vc_h vc, vc_state_e* state, vc_state_e* previous_state) { vc_mgr_client_s* client = __mgr_client_get(vc); @@ -868,7 +868,7 @@ int vc_mgr_client_get_before_state(vc_h vc, vc_state_e* state, vc_state_e* befor if (NULL == client) return VC_ERROR_INVALID_PARAMETER; - *before_state = client->before_state; + *previous_state = client->previous_state; *state = client->current_state; return VC_ERROR_NONE; diff --git a/client/vc_mgr_client.h b/client/vc_mgr_client.h index dfcfde1..ffa4e08 100644 --- a/client/vc_mgr_client.h +++ b/client/vc_mgr_client.h @@ -129,7 +129,7 @@ int vc_mgr_client_get_client_state(vc_h vc, vc_state_e* state); int vc_mgr_client_get_client_state_by_uid(unsigned int uid, vc_state_e* state); -int vc_mgr_client_get_before_state(vc_h vc, vc_state_e* state, vc_state_e* before_state); +int vc_mgr_client_get_previous_state(vc_h vc, vc_state_e* state, vc_state_e* previous_state); int vc_mgr_client_set_error(vc_h vc, int reason); diff --git a/client/vc_setting.c b/client/vc_setting.c index aabd0b8..999c716 100644 --- a/client/vc_setting.c +++ b/client/vc_setting.c @@ -45,19 +45,19 @@ static void* g_enabled_changed_user_data = NULL; static vc_setting_current_language_changed_cb g_current_language_changed_cb = NULL; static void* g_current_language_changed_user_data = NULL; -void __config_lang_changed_cb(const char* before_lang, const char* current_lang) +void __config_lang_changed_cb(const char* previous_lang, const char* current_lang) { - SLOG(LOG_DEBUG, TAG_VCS, "Lang changed : before(%s) current(%s)", before_lang, current_lang); + SLOG(LOG_DEBUG, TAG_VCS, "Lang changed : previous(%s) current(%s)", previous_lang, current_lang); if (NULL != g_current_language_changed_cb) { - g_current_language_changed_cb(before_lang, current_lang, g_current_language_changed_user_data); + g_current_language_changed_cb(previous_lang, current_lang, g_current_language_changed_user_data); } } -void __vc_setting_state_changed_cb(int before_state, int current_state, void* user_data) +void __vc_setting_state_changed_cb(int previous_state, int current_state, void* user_data) { - SLOG(LOG_DEBUG, TAG_VCS, "Service State changed : Before(%d) Current(%d)", - before_state, current_state); + SLOG(LOG_DEBUG, TAG_VCS, "Service State changed : previous(%d) current(%d)", + previous_state, current_state); return; } diff --git a/client/vc_tidl.c b/client/vc_tidl.c index ac5550f..ed216ea 100644 --- a/client/vc_tidl.c +++ b/client/vc_tidl.c @@ -37,7 +37,7 @@ typedef struct { static GList* g_tidl_infos = NULL; -extern int __vc_cb_error_to_app(int pid, int reason, char* msg); +extern int __vc_cb_error(int reason, char* msg); extern void __vc_cb_result(); extern int __vc_cb_service_state(int state); extern int __vc_cb_manager_pid(int manager_pid); @@ -210,7 +210,7 @@ static void __notify_cb(void* user_data, int pid, bundle* msg) bundle_get_str(msg, VC_BUNDLE_ERR_MSG, &err_msg); SLOG(LOG_DEBUG, TAG_VCC, "@@ vc Get Error message : reason(%d), pid(%d), msg(%s)", atoi(reason), atoi(pid), err_msg); - __vc_cb_error_to_app(atoi(pid), atoi(reason), err_msg); + __vc_cb_error(atoi(reason), err_msg); } /* VCD_METHOD_ERROR_TO_APP */ else if (0 == strncmp(VC_MANAGER_METHOD_UTTERANCE_STATUS, method, strlen(VC_MANAGER_METHOD_UTTERANCE_STATUS))) { /* signal!!! */ diff --git a/client/vc_widget.c b/client/vc_widget.c index d4816f0..1e3a90e 100644 --- a/client/vc_widget.c +++ b/client/vc_widget.c @@ -124,10 +124,10 @@ static int __vc_widget_convert_config_error_code(vc_config_error_e code) return VC_ERROR_NONE; } -static void __vc_widget_lang_changed_cb(const char* before_lang, const char* current_lang) +static void __vc_widget_lang_changed_cb(const char* previous_lang, const char* current_lang) { - SLOG(LOG_DEBUG, TAG_VCW, "Lang changed : Before lang(%s) Current lang(%s)", - before_lang, current_lang); + SLOG(LOG_DEBUG, TAG_VCW, "Lang changed : previous lang(%s) Current lang(%s)", + previous_lang, current_lang); vc_current_language_changed_cb callback; void* lang_user_data; @@ -148,7 +148,7 @@ static void __vc_widget_lang_changed_cb(const char* before_lang, const char* cur if (NULL != callback) { vc_widget_client_use_callback(vc_w); - callback(before_lang, current_lang, lang_user_data); + callback(previous_lang, current_lang, lang_user_data); vc_widget_client_not_use_callback(vc_w); SLOG(LOG_DEBUG, TAG_VCW, "Language changed callback is called"); } else { @@ -489,13 +489,13 @@ static Eina_Bool __vc_widget_connect_daemon(void *data) vc_widget_client_get_state_changed_cb(vc_w, &changed_callback, &user_data); vc_state_e current_state; - vc_state_e before_state; + vc_state_e previous_state; - vc_widget_client_get_before_state(vc_w, ¤t_state, &before_state); + vc_widget_client_get_previous_state(vc_w, ¤t_state, &previous_state); if (NULL != changed_callback) { vc_widget_client_use_callback(vc_w); - changed_callback(before_state, current_state, user_data); + changed_callback(previous_state, current_state, user_data); vc_widget_client_not_use_callback(vc_w); SLOG(LOG_DEBUG, TAG_VCW, "State changed callback is called"); } else { @@ -1399,13 +1399,13 @@ static Eina_Bool __vc_widget_notify_state_changed(void *data) vc_widget_client_get_state_changed_cb(vc_w, &changed_callback, &user_data); vc_state_e current_state; - vc_state_e before_state; + vc_state_e previous_state; - vc_widget_client_get_before_state(vc_w, ¤t_state, &before_state); + vc_widget_client_get_previous_state(vc_w, ¤t_state, &previous_state); if (NULL != changed_callback) { vc_widget_client_use_callback(vc_w); - changed_callback(before_state, current_state, user_data); + changed_callback(previous_state, current_state, user_data); vc_widget_client_not_use_callback(vc_w); SLOG(LOG_DEBUG, TAG_VCW, "State changed callback is called"); } else { @@ -1577,15 +1577,15 @@ int __vc_widget_cb_service_state(int state) vc_w = data->vc; vc_service_state_e current_state = (vc_service_state_e)state; - vc_service_state_e before_state; - vc_widget_client_get_service_state(vc_w, &before_state); + vc_service_state_e previous_state; + vc_widget_client_get_service_state(vc_w, &previous_state); - if (current_state == before_state) { + if (current_state == previous_state) { continue; } - SLOG(LOG_DEBUG, TAG_VCW, "Service State changed : Before(%d) Current(%d)", - before_state, current_state); + SLOG(LOG_DEBUG, TAG_VCW, "Service State changed : previous(%d) current(%d)", + previous_state, current_state); /* Save service state */ vc_widget_client_set_service_state(vc_w, current_state); @@ -1596,7 +1596,7 @@ int __vc_widget_cb_service_state(int state) if (NULL != callback) { vc_widget_client_use_callback(vc_w); - callback((vc_service_state_e)before_state, (vc_service_state_e)current_state, service_user_data); + callback((vc_service_state_e)previous_state, (vc_service_state_e)current_state, service_user_data); vc_widget_client_not_use_callback(vc_w); SLOG(LOG_DEBUG, TAG_VCW, "Service state changed callback is called"); } else { diff --git a/client/vc_widget_client.c b/client/vc_widget_client.c index 891ba75..5607a7a 100644 --- a/client/vc_widget_client.c +++ b/client/vc_widget_client.c @@ -112,7 +112,7 @@ int vc_widget_client_create(vc_h* vc) widget->error_cb = NULL; widget->error_user_data = NULL; - widget->before_state = VC_STATE_INITIALIZED; + widget->previous_state = VC_STATE_INITIALIZED; widget->current_state = VC_STATE_INITIALIZED; widget->conn_timer = NULL; @@ -527,7 +527,7 @@ int vc_widget_client_set_state(vc_h vc, vc_state_e state) if (NULL == widget) return VC_ERROR_INVALID_PARAMETER; - widget->before_state = widget->current_state; + widget->previous_state = widget->current_state; widget->current_state = state; return VC_ERROR_NONE; @@ -570,7 +570,7 @@ int vc_widget_client_get_state_by_uid(unsigned int uid, vc_state_e* state) return VC_ERROR_INVALID_PARAMETER; } -int vc_widget_client_get_before_state(vc_h vc, vc_state_e* state, vc_state_e* before_state) +int vc_widget_client_get_previous_state(vc_h vc, vc_state_e* state, vc_state_e* previous_state) { vc_widget_s* widget = widget_get(vc); @@ -578,7 +578,7 @@ int vc_widget_client_get_before_state(vc_h vc, vc_state_e* state, vc_state_e* be if (NULL == widget) return VC_ERROR_INVALID_PARAMETER; - *before_state = widget->before_state; + *previous_state = widget->previous_state; *state = widget->current_state; return VC_ERROR_NONE; diff --git a/client/vc_widget_client.h b/client/vc_widget_client.h index 5ef3a55..990007e 100644 --- a/client/vc_widget_client.h +++ b/client/vc_widget_client.h @@ -59,7 +59,7 @@ typedef struct { vc_service_state_e service_state; /* state */ - vc_state_e before_state; + vc_state_e previous_state; vc_state_e current_state; Ecore_Timer* conn_timer; @@ -138,7 +138,7 @@ int vc_widget_client_get_state(vc_h vc, vc_state_e* state); int vc_widget_client_get_state_by_uid(unsigned int uid, vc_state_e* state); -int vc_widget_client_get_before_state(vc_h vc, vc_state_e* state, vc_state_e* before_state); +int vc_widget_client_get_previous_state(vc_h vc, vc_state_e* state, vc_state_e* previous_state); int vc_widget_client_set_xid(vc_h vc, int xid);