From 78389e5743dce9a5417c55c6a77d9d7f4e274430 Mon Sep 17 00:00:00 2001 From: "sooyeon.kim" Date: Tue, 31 Jul 2018 19:03:09 +0900 Subject: [PATCH 01/16] Add line coverage tags Change-Id: Ib7785c22ae0597488ba869ec81aeae35b4758959 Signed-off-by: sooyeon.kim --- src/vc_elm.c | 94 ++++++++++++++++++++++++++++++------------------------------ 1 file changed, 47 insertions(+), 47 deletions(-) diff --git a/src/vc_elm.c b/src/vc_elm.c index b884266..38621d3 100644 --- a/src/vc_elm.c +++ b/src/vc_elm.c @@ -83,7 +83,7 @@ static int g_click_method = 0; static int __vc_elm_get_feature_enabled() { if (0 == g_feature_enabled) { - VC_ELM_LOG_DBG("[ERROR] Voice control feature NOT supported"); + VC_ELM_LOG_DBG("[ERROR] Voice control feature NOT supported"); //LCOV_EXCL_LINE return VC_ELM_ERROR_NOT_SUPPORTED; } else if (-1 == g_feature_enabled) { bool vc_supported = false; @@ -91,18 +91,18 @@ static int __vc_elm_get_feature_enabled() if (0 == system_info_get_platform_bool(VC_ELM_FEATURE_PATH, &vc_supported)) { if (0 == system_info_get_platform_bool(VC_ELM_MIC_FEATURE_PATH, &mic_supported)) { if (false == vc_supported || false == mic_supported) { - VC_ELM_LOG_DBG("[ERROR] Voice control feature NOT supported"); + VC_ELM_LOG_DBG("[ERROR] Voice control feature NOT supported"); //LCOV_EXCL_LINE g_feature_enabled = 0; return VC_ELM_ERROR_NOT_SUPPORTED; } g_feature_enabled = 1; } else { - VC_ELM_LOG_DBG("[ERROR] Fail to get feature value"); + VC_ELM_LOG_DBG("[ERROR] Fail to get feature value"); //LCOV_EXCL_LINE return VC_ELM_ERROR_NOT_SUPPORTED; } } else { - VC_ELM_LOG_DBG("[ERROR] Fail to get feature value"); + VC_ELM_LOG_DBG("[ERROR] Fail to get feature value"); //LCOV_EXCL_LINE return VC_ELM_ERROR_NOT_SUPPORTED; } } @@ -113,7 +113,7 @@ static int __check_privilege_initialize() { int ret = cynara_initialize(&p_cynara, NULL); if (CYNARA_API_SUCCESS != ret) - VC_ELM_LOG_ERR("[ERROR] fail to initialize"); + VC_ELM_LOG_ERR("[ERROR] fail to initialize"); //LCOV_EXCL_LINE return ret == CYNARA_API_SUCCESS; } @@ -131,7 +131,7 @@ static int __check_privilege(const char* uid, const char * privilege) fp = fopen(label_path, "r"); if (fp != NULL) { if (0 >= fread(smack_label, 1, sizeof(smack_label), fp)) - VC_ELM_LOG_ERR("[ERROR] fail to fread"); + VC_ELM_LOG_ERR("[ERROR] fail to fread"); //LCOV_EXCL_LINE fclose(fp); } @@ -160,16 +160,16 @@ static int __vc_elm_check_privilege() char uid[16]; if (0 == g_privilege_allowed) { - VC_ELM_LOG_ERR("[ERROR] Permission is denied"); + VC_ELM_LOG_ERR("[ERROR] Permission is denied"); //LCOV_EXCL_LINE return VC_ELM_ERROR_PERMISSION_DENIED; } else if (-1 == g_privilege_allowed) { if (false == __check_privilege_initialize()) { - VC_ELM_LOG_ERR("[ERROR] privilege initialize is failed"); + VC_ELM_LOG_ERR("[ERROR] privilege initialize is failed"); //LCOV_EXCL_LINE return VC_ELM_ERROR_PERMISSION_DENIED; } snprintf(uid, 16, "%d", getuid()); if (false == __check_privilege(uid, VC_ELM_PRIVILEGE)) { - VC_ELM_LOG_ERR("[ERROR] Permission is denied"); + VC_ELM_LOG_ERR("[ERROR] Permission is denied"); //LCOV_EXCL_LINE g_privilege_allowed = 0; __check_privilege_deinitialize(); return VC_ELM_ERROR_PERMISSION_DENIED; @@ -186,7 +186,7 @@ void __vc_config_vtauto_changed_cb(keynode_t *key, void *data) (void)data; //unused parameter int ret = vconf_get_bool(VCONFKEY_VC_VOICE_TOUCH_AUTOMODE, &g_is_vt_automode); if (0 != ret) { - VC_ELM_LOG_ERR("Fail to get vconfkey(%s), current voice touch mode(%d)", key, g_is_vt_automode); + VC_ELM_LOG_ERR("Fail to get vconfkey(%s), current voice touch mode(%d)", key, g_is_vt_automode); //LCOV_EXCL_LINE } return; @@ -199,7 +199,7 @@ int vc_elm_initialize() } if (true == is_vc_elm_initialized) { - VC_ELM_LOG_DBG("vc elm is already initialized"); + VC_ELM_LOG_DBG("vc elm is already initialized"); //LCOV_EXCL_LINE return VC_ELM_ERROR_INVALID_STATE; } @@ -232,7 +232,7 @@ int vc_elm_deinitialize() } if (false == is_vc_elm_initialized) { - VC_ELM_LOG_DBG("vc elm is already deinitialized"); + VC_ELM_LOG_DBG("vc elm is already deinitialized"); //LCOV_EXCL_LINE return VC_ELM_ERROR_INVALID_STATE; } @@ -312,18 +312,18 @@ int vc_elm_foreach_supported_widgets(vc_elm_widget_cb callback, void *user_data) } if (NULL == callback) { - VC_ELM_LOG_ERR("Invalid parameters detected!"); + VC_ELM_LOG_ERR("Invalid parameters detected!"); //LCOV_EXCL_LINE return VC_ELM_ERROR_INVALID_PARAMETER; } if (false == is_vc_elm_initialized) { - VC_ELM_LOG_ERR("Invalid state detected! Library not initialized!"); + VC_ELM_LOG_ERR("Invalid state detected! Library not initialized!"); //LCOV_EXCL_LINE return VC_ELM_ERROR_INVALID_STATE; } data.callback = callback; data.data = user_data; hash = _vc_elm_core_get_config_widget_map(); if (NULL == hash) { - VC_ELM_LOG_ERR("Config widget map is NULL!"); + VC_ELM_LOG_ERR("Config widget map is NULL!"); //LCOV_EXCL_LINE return VC_ELM_ERROR_OPERATION_FAILED; } eina_hash_foreach(hash, __hash_fn, &data); @@ -345,21 +345,21 @@ int vc_elm_foreach_supported_actions(const char *widget, vc_elm_action_cb callba } if ((NULL == widget) || (NULL == callback)) { - VC_ELM_LOG_ERR("Invalid parameters detected!"); + VC_ELM_LOG_ERR("Invalid parameters detected!"); //LCOV_EXCL_LINE return VC_ELM_ERROR_INVALID_PARAMETER; } if (false == is_vc_elm_initialized) { - VC_ELM_LOG_ERR("Invalid state detected! Library not initialized!"); + VC_ELM_LOG_ERR("Invalid state detected! Library not initialized!"); //LCOV_EXCL_LINE return VC_ELM_ERROR_INVALID_STATE; } hash = _vc_elm_core_get_config_widget_map(); if (NULL == hash) { - VC_ELM_LOG_ERR("Config widget map is NULL!"); + VC_ELM_LOG_ERR("Config widget map is NULL!"); //LCOV_EXCL_LINE return VC_ELM_ERROR_OPERATION_FAILED; } actions_list = (Eina_List *)eina_hash_find(hash, widget); if (NULL == actions_list) { - VC_ELM_LOG_ERR("Action list is NULL!"); + VC_ELM_LOG_ERR("Action list is NULL!"); //LCOV_EXCL_LINE return VC_ELM_ERROR_OPERATION_FAILED; } EINA_LIST_FOREACH(actions_list, l, action_tag) { @@ -384,27 +384,27 @@ int vc_elm_get_action_command(const char *action, char **command) } if ((NULL == action) || (NULL == command)) { - VC_ELM_LOG_ERR("Invalid parameters detected!"); + VC_ELM_LOG_ERR("Invalid parameters detected!"); //LCOV_EXCL_LINE return VC_ELM_ERROR_INVALID_PARAMETER; } if (false == is_vc_elm_initialized) { - VC_ELM_LOG_ERR("Invalid state detected! Library not initialized!"); + VC_ELM_LOG_ERR("Invalid state detected! Library not initialized!"); //LCOV_EXCL_LINE return VC_ELM_ERROR_INVALID_STATE; } hash = _vc_elm_core_get_config_action_map(); if (NULL == hash) { - VC_ELM_LOG_ERR("Config action map is NULL!"); + VC_ELM_LOG_ERR("Config action map is NULL!"); //LCOV_EXCL_LINE return VC_ELM_ERROR_OPERATION_FAILED; } command_name = eina_hash_find(_vc_elm_core_get_config_action_map(), action); if (NULL == command_name) { - VC_ELM_LOG_ERR("No command for given action name!"); + VC_ELM_LOG_ERR("No command for given action name!"); //LCOV_EXCL_LINE return VC_ELM_ERROR_OPERATION_FAILED; } len = strlen(command_name) + 1; *command = (char *)calloc(len, sizeof(char)); if (NULL == *command) { - VC_ELM_LOG_ERR("Can not allocate memory!"); + VC_ELM_LOG_ERR("Can not allocate memory!"); //LCOV_EXCL_LINE return VC_ELM_ERROR_OPERATION_FAILED; } memcpy(*command, command_name, len); @@ -424,26 +424,26 @@ int vc_elm_create_object(Evas_Object *object, vc_elm_h *vc_elm) } if (NULL == vc_elm) { - VC_ELM_LOG_ERR("Invalid parameters detected! (vc_elm_h *) poiter is NULL"); + VC_ELM_LOG_ERR("Invalid parameters detected! (vc_elm_h *) poiter is NULL"); //LCOV_EXCL_LINE return VC_ELM_ERROR_INVALID_PARAMETER; } if ((NULL == object) || (!elm_object_widget_check(object))) { - VC_ELM_LOG_ERR("Invalid parameters detected! Incorrect (Evas_Object *)"); + VC_ELM_LOG_ERR("Invalid parameters detected! Incorrect (Evas_Object *)"); //LCOV_EXCL_LINE *vc_elm = NULL; return VC_ELM_ERROR_INVALID_PARAMETER; } if (false == is_vc_elm_initialized) { - VC_ELM_LOG_ERR("Invalid state detected! Library not initialized!"); + VC_ELM_LOG_ERR("Invalid state detected! Library not initialized!"); //LCOV_EXCL_LINE return VC_ELM_ERROR_INVALID_STATE; } if (!_vc_elm_core_register_default_widget(_get_ui_object_name(object), EINA_FALSE, NULL) || (NULL == eina_hash_find(_vc_elm_core_get_config_widget_map(), elm_widget_type_get(object)))) { - VC_ELM_LOG_ERR("Not supported widget"); + VC_ELM_LOG_ERR("Not supported widget"); //LCOV_EXCL_LINE *vc_elm = NULL; return VC_ELM_ERROR_NOT_SUPPORTED; } handler = (vc_elm_s *)calloc(1, sizeof(vc_elm_s)); if (NULL == handler) { - VC_ELM_LOG_ERR("Calloc function returned NULL"); + VC_ELM_LOG_ERR("Calloc function returned NULL"); //LCOV_EXCL_LINE return VC_ELM_ERROR_OUT_OF_MEMORY; } handler->type = VC_ELM_TYPE_EVAS_OBJECT; @@ -467,21 +467,21 @@ int vc_elm_create_item(Elm_Object_Item *item, vc_elm_h *vc_elm) } if (NULL == vc_elm) { - VC_ELM_LOG_ERR("Invalid parameters detected! (vc_elm_h *) poiter is NULL"); + VC_ELM_LOG_ERR("Invalid parameters detected! (vc_elm_h *) poiter is NULL"); //LCOV_EXCL_LINE return VC_ELM_ERROR_INVALID_PARAMETER; } if (NULL == item) { - VC_ELM_LOG_ERR("Invalid parameters detected! (Elm_Object_Item *) poiter is NULL"); + VC_ELM_LOG_ERR("Invalid parameters detected! (Elm_Object_Item *) poiter is NULL"); //LCOV_EXCL_LINE *vc_elm = NULL; return VC_ELM_ERROR_INVALID_PARAMETER; } if (false == is_vc_elm_initialized) { - VC_ELM_LOG_ERR("Invalid state detected! Library not initialized!"); + VC_ELM_LOG_ERR("Invalid state detected! Library not initialized!"); //LCOV_EXCL_LINE return VC_ELM_ERROR_INVALID_STATE; } handler = (vc_elm_s *)calloc(1, sizeof(vc_elm_s)); if (NULL == handler) { - VC_ELM_LOG_ERR("Calloc function returned NULL"); + VC_ELM_LOG_ERR("Calloc function returned NULL"); //LCOV_EXCL_LINE *vc_elm = NULL; return VC_ELM_ERROR_OUT_OF_MEMORY; } @@ -508,19 +508,19 @@ int vc_elm_destroy(vc_elm_h vc_elm) } if (NULL == vc_elm) { - VC_ELM_LOG_ERR("Invalid vc_elm parameter detected!"); + VC_ELM_LOG_ERR("Invalid vc_elm parameter detected!"); //LCOV_EXCL_LINE return VC_ELM_ERROR_INVALID_PARAMETER; } handler = (vc_elm_s *)vc_elm; type = handler->type; if (!((VC_ELM_TYPE_EVAS_OBJECT == type) || (VC_ELM_TYPE_ITEM == type))) { - VC_ELM_LOG_ERR("Invalid type detected!"); + VC_ELM_LOG_ERR("Invalid type detected!"); //LCOV_EXCL_LINE return VC_ELM_ERROR_INVALID_PARAMETER; } list = eina_list_data_find_list(g_handlers_list, handler); if (NULL == list) { - VC_ELM_LOG_ERR("Bad handler pointer detected!"); + VC_ELM_LOG_ERR("Bad handler pointer detected!"); //LCOV_EXCL_LINE return VC_ELM_ERROR_INVALID_PARAMETER; } g_handlers_list = eina_list_remove_list(g_handlers_list, list); @@ -544,7 +544,7 @@ int vc_elm_set_command(vc_elm_h vc_elm, const char *command) } if (NULL == vc_elm) { - VC_ELM_LOG_ERR("Invalid vc_elm parameter detected!"); + VC_ELM_LOG_ERR("Invalid vc_elm parameter detected!"); //LCOV_EXCL_LINE return VC_ELM_ERROR_INVALID_PARAMETER; } type = handler->type; @@ -573,7 +573,7 @@ int vc_elm_unset_command(vc_elm_h vc_elm) } if (NULL == vc_elm) { - VC_ELM_LOG_ERR("Invalid vc_elm parameter detected!"); + VC_ELM_LOG_ERR("Invalid vc_elm parameter detected!"); //LCOV_EXCL_LINE return VC_ELM_ERROR_INVALID_PARAMETER; } type = handler->type; @@ -602,7 +602,7 @@ int vc_elm_set_command_hint(vc_elm_h vc_elm, const char* hint) } if (NULL == vc_elm) { - VC_ELM_LOG_ERR("Invalid vc_elm parameter detected!"); + VC_ELM_LOG_ERR("Invalid vc_elm parameter detected!"); //LCOV_EXCL_LINE return VC_ELM_ERROR_INVALID_PARAMETER; } type = handler->type; @@ -631,7 +631,7 @@ int vc_elm_unset_command_hint(vc_elm_h vc_elm) } if (NULL == vc_elm) { - VC_ELM_LOG_ERR("Invalid vc_elm parameter detected!"); + VC_ELM_LOG_ERR("Invalid vc_elm parameter detected!"); //LCOV_EXCL_LINE return VC_ELM_ERROR_INVALID_PARAMETER; } type = handler->type; @@ -660,7 +660,7 @@ int vc_elm_set_command_hint_direction(vc_elm_h vc_elm, vc_elm_direction_e direct } if (NULL == vc_elm) { - VC_ELM_LOG_ERR("Invalid vc_elm parameter detected!"); + VC_ELM_LOG_ERR("Invalid vc_elm parameter detected!"); //LCOV_EXCL_LINE return VC_ELM_ERROR_INVALID_PARAMETER; } type = handler->type; @@ -690,7 +690,7 @@ int vc_elm_get_command_hint_direction(vc_elm_h vc_elm, vc_elm_direction_e *direc } if (NULL == vc_elm) { - VC_ELM_LOG_ERR("Invalid vc_elm parameter detected!"); + VC_ELM_LOG_ERR("Invalid vc_elm parameter detected!"); //LCOV_EXCL_LINE return VC_ELM_ERROR_INVALID_PARAMETER; } type = handler->type; @@ -719,7 +719,7 @@ int vc_elm_set_command_hint_offset(vc_elm_h vc_elm, int pos_x, int pos_y) } if (NULL == vc_elm) { - VC_ELM_LOG_ERR("Invalid vc_elm parameter detected!"); + VC_ELM_LOG_ERR("Invalid vc_elm parameter detected!"); //LCOV_EXCL_LINE return VC_ELM_ERROR_INVALID_PARAMETER; } type = handler->type; @@ -749,11 +749,11 @@ int vc_elm_get_command_hint_offset(vc_elm_h vc_elm, int *pos_x, int *pos_y) } if (NULL == vc_elm) { - VC_ELM_LOG_ERR("Invalid vc_elm parameter detected!"); + VC_ELM_LOG_ERR("Invalid vc_elm parameter detected!"); //LCOV_EXCL_LINE return VC_ELM_ERROR_INVALID_PARAMETER; } if ((NULL == pos_x) || (NULL == pos_y)) { - VC_ELM_LOG_ERR("Invalid position poiters detected!"); + VC_ELM_LOG_ERR("Invalid position poiters detected!"); //LCOV_EXCL_LINE return VC_ELM_ERROR_INVALID_PARAMETER; } type = handler->type; @@ -779,7 +779,7 @@ int vc_elm_set_current_language_changed_cb(vc_elm_current_language_changed_cb ca } if (false == is_vc_elm_initialized) { - VC_ELM_LOG_ERR("Invalid state detected! Library not initialized!"); + VC_ELM_LOG_ERR("Invalid state detected! Library not initialized!"); //LCOV_EXCL_LINE return VC_ELM_ERROR_INVALID_STATE; } @@ -802,7 +802,7 @@ int vc_elm_unset_current_language_changed_cb(void) } if (false == is_vc_elm_initialized) { - VC_ELM_LOG_ERR("Invalid state detected! Library not initialized!"); + VC_ELM_LOG_ERR("Invalid state detected! Library not initialized!"); //LCOV_EXCL_LINE return VC_ELM_ERROR_INVALID_STATE; } -- 2.7.4 From f27b03c4dc0d2248610bcd703d3691b487420098 Mon Sep 17 00:00:00 2001 From: "sooyeon.kim" Date: Thu, 16 Aug 2018 15:58:52 +0900 Subject: [PATCH 02/16] Fix corrupted double-linked list Change-Id: Ib3ac1485157c741f0f5c245892155e25b42d8564 Signed-off-by: sooyeon.kim --- src/vc_elm_core.c | 114 ++++++++++++++++++++++++++++++++++++------------------ 1 file changed, 77 insertions(+), 37 deletions(-) diff --git a/src/vc_elm_core.c b/src/vc_elm_core.c index d46c05d..df50407 100644 --- a/src/vc_elm_core.c +++ b/src/vc_elm_core.c @@ -2351,18 +2351,26 @@ int _vc_elm_core_read_xml_data() while (tmp != NULL) { if (0 == xmlStrcmp(tmp->name, XML_CAST VC_ELM_TAG_ACTION_NAME)) { key = xmlNodeGetContent(tmp); - VC_ELM_LOG_DBG("action name %s", (char *)key); - action_name = eina_stringshare_add((char *)key); - xmlFree(key); + if (NULL != key) { + VC_ELM_LOG_DBG("action name %s", (char *)key); + action_name = eina_stringshare_add((char *)key); + xmlFree(key); + } else { + VC_ELM_LOG_DBG("action name is NULL"); + } } else if (0 == xmlStrcmp(tmp->name, XML_CAST VC_ELM_TAG_ACTION_COMMAND)) { const char *action_command = NULL; key = xmlNodeGetContent(tmp); - VC_ELM_LOG_DBG("action command %s", (char *)key); - if (action_name != NULL) { - action_command = eina_stringshare_add((char *)key); - eina_hash_add(g_config_action_map, action_name, action_command); + if (NULL != key) { + VC_ELM_LOG_DBG("action command %s", (char *)key); + if (action_name != NULL) { + action_command = eina_stringshare_add((char *)key); + eina_hash_add(g_config_action_map, action_name, action_command); + } + xmlFree(key); + } else { + VC_ELM_LOG_DBG("action command is NULL"); } - xmlFree(key); } tmp = tmp->next; } @@ -2378,9 +2386,13 @@ int _vc_elm_core_read_xml_data() while (tmp != NULL) { if (0 == xmlStrcmp(tmp->name, XML_CAST VC_ELM_TAG_WIDGET_NAME)) { key = xmlNodeGetContent(tmp); - VC_ELM_LOG_DBG("widget name %s", (char *)key); - widget_name = eina_stringshare_add((char *)key); - xmlFree(key); + if (NULL != key) { + VC_ELM_LOG_DBG("widget name %s", (char *)key); + widget_name = eina_stringshare_add((char *)key); + xmlFree(key); + } else { + VC_ELM_LOG_DBG("widget name is NULL"); + } } else if (0 == xmlStrcmp(tmp->name, XML_CAST VC_ELM_TAG_WIDGET_ACTIONS)) { xmlNodePtr actions = tmp->xmlChildrenNode; Eina_List *actions_list = NULL; @@ -2388,10 +2400,14 @@ int _vc_elm_core_read_xml_data() if (0 == xmlStrcmp(actions->name, XML_CAST VC_ELM_TAG_ACTION_NAME)) { const char *action_tag = NULL; key = xmlNodeGetContent(actions); - VC_ELM_LOG_DBG("widget action name %s", (char*)key); - action_tag = eina_stringshare_add((char*)key); - actions_list = eina_list_append(actions_list, action_tag); - xmlFree(key); + if (NULL != key) { + VC_ELM_LOG_DBG("widget action name %s", (char*)key); + action_tag = eina_stringshare_add((char*)key); + actions_list = eina_list_append(actions_list, action_tag); + xmlFree(key); + } else { + VC_ELM_LOG_DBG("widget action name is NULL"); + } } actions = actions->next; } @@ -2408,26 +2424,38 @@ int _vc_elm_core_read_xml_data() while (child != NULL) { if (0 == xmlStrcmp(child->name, XML_CAST VC_ELM_TAG_HINT_SHOW)) { key = xmlNodeGetContent(child); - VC_ELM_LOG_DBG("hint show %s", (char*)key); - if (g_tooltips_show) - free(g_tooltips_show); - g_tooltips_show = strdup((char*)key); - xmlFree(key); + if (NULL != key) { + VC_ELM_LOG_DBG("hint show %s", (char*)key); + if (g_tooltips_show) + free(g_tooltips_show); + g_tooltips_show = strdup((char*)key); + xmlFree(key); + } else { + VC_ELM_LOG_DBG("hint show is NULL"); + } } else if (0 == xmlStrcmp(child->name, XML_CAST VC_ELM_TAG_HINT_DIRECTION)) { key = xmlNodeGetContent(child); - VC_ELM_LOG_DBG("hint direction %s", (char*)key); - if (g_tooltips_default_direction) - free(g_tooltips_default_direction); - g_tooltips_default_direction = strdup((char*)key); - xmlFree(key); + if (NULL != key) { + VC_ELM_LOG_DBG("hint direction %s", (char*)key); + if (g_tooltips_default_direction) + free(g_tooltips_default_direction); + g_tooltips_default_direction = strdup((char*)key); + xmlFree(key); + } else { + VC_ELM_LOG_DBG("hint direction is NULL"); + } } else if (0 == xmlStrcmp(child->name, XML_CAST VC_ELM_TAG_HINT_IMAGE)) { key = xmlNodeGetContent(child); - VC_ELM_LOG_DBG("hint image %s", (char*)key); - if (g_tooltips_image_path) - free(g_tooltips_image_path); - charkey = tzplatform_mkpath(TZ_SYS_RO_SHARE, (const char*)key); - g_tooltips_image_path = strdup(charkey); - xmlFree(key); + if (NULL != key) { + VC_ELM_LOG_DBG("hint image %s", (char*)key); + if (g_tooltips_image_path) + free(g_tooltips_image_path); + charkey = tzplatform_mkpath(TZ_SYS_RO_SHARE, (const char*)key); + g_tooltips_image_path = strdup(charkey); + xmlFree(key); + } else { + VC_ELM_LOG_DBG("hint image is NULL"); + } } child = child->next; } @@ -2439,16 +2467,28 @@ int _vc_elm_core_read_xml_data() while (cur != NULL) { if (0 == xmlStrcmp(cur->name, XML_CAST VC_ELM_TAG_TIZEN_VERSION)) { key = xmlNodeGetContent(cur); - VC_ELM_LOG_DBG("hint direction %s", (char*)key); - xmlFree(key); + if (NULL != key) { + VC_ELM_LOG_DBG("hint direction %s", (char*)key); + xmlFree(key); + } else { + VC_ELM_LOG_DBG("hint direction is NULL"); + } } else if (0 == xmlStrcmp(cur->name, XML_CAST VC_ELM_TAG_PROFILE)) { key = xmlNodeGetContent(cur); - VC_ELM_LOG_DBG("hint direction %s", (char*)key); - xmlFree(key); + if (NULL != key) { + VC_ELM_LOG_DBG("hint direction %s", (char*)key); + xmlFree(key); + } else { + VC_ELM_LOG_DBG("hint direction is NULL"); + } } else if (0 == xmlStrcmp(cur->name, XML_CAST VC_ELM_TAG_EFL_VERSION)) { key = xmlNodeGetContent(cur); - VC_ELM_LOG_DBG("hint direction %s", (char*)key); - xmlFree(key); + if (NULL != key) { + VC_ELM_LOG_DBG("hint direction %s", (char*)key); + xmlFree(key); + } else { + VC_ELM_LOG_DBG("hint direction is NULL"); + } } cur = cur->next; } -- 2.7.4 From cef96aee8e177354eb1dab092d7376c20178a85e Mon Sep 17 00:00:00 2001 From: Wonnam Jang Date: Fri, 17 Aug 2018 14:06:06 +0900 Subject: [PATCH 03/16] Check if window object is or not, before checking focus Change-Id: I25264fd2215d02582374d6e50c6e310a72612e23 Signed-off-by: Wonnam Jang --- src/vc_elm_core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/vc_elm_core.c b/src/vc_elm_core.c index d46c05d..76f9e1a 100644 --- a/src/vc_elm_core.c +++ b/src/vc_elm_core.c @@ -2234,7 +2234,7 @@ static Eina_Bool __idle_enter(void *data) EINA_LIST_FREE(objs, obj) { VC_ELM_LOG_DBG("foreach obj %p", (void*)obj); window = elm_object_top_widget_get(obj); - if (window && EINA_TRUE == elm_win_focus_get(window)) { + if (window && !strcmp(evas_object_type_get(window), "Elm_Win") && EINA_TRUE == elm_win_focus_get(window)) { VC_ELM_LOG_DBG("NEW Focused g_default %ud", elm_win_xwindow_get(window)); g_default_window = window; } -- 2.7.4 From bf04a25765315c67a92e388c27de79a02bedeb95 Mon Sep 17 00:00:00 2001 From: "sooyeon.kim" Date: Tue, 28 Aug 2018 15:50:31 +0900 Subject: [PATCH 04/16] Fix spelling errata Change-Id: Id991a9209b714be8f39ba3709289ee5409cc3c7c Signed-off-by: sooyeon.kim --- include/voice_control_elm_private.h | 2 +- src/vc_elm.c | 10 +++++----- src/vc_elm_core.c | 12 ++++++------ src/vc_elm_core.h | 8 ++++---- src/vc_elm_core_default_widgets.c | 6 +++--- src/vc_elm_tooltip.h | 2 +- src/vc_elm_widget_wrapper.c | 2 +- 7 files changed, 21 insertions(+), 21 deletions(-) diff --git a/include/voice_control_elm_private.h b/include/voice_control_elm_private.h index 4559023..09516e2 100644 --- a/include/voice_control_elm_private.h +++ b/include/voice_control_elm_private.h @@ -72,7 +72,7 @@ int vc_elm_get_auto_register_mode(int* mode, int* click_method); * @brief Add allowed text part for auto command register. * @since_tizen 3.0 * -* @param[in] text_part The text part of elemenatry widget +* @param[in] text_part The text part of elementary widget * * @return 0 on success, otherwise a negative error value * @retval #VC_ELM_ERROR_NONE Successful diff --git a/src/vc_elm.c b/src/vc_elm.c index 38621d3..69ab635 100644 --- a/src/vc_elm.c +++ b/src/vc_elm.c @@ -39,7 +39,7 @@ #define VC_ELM_MODE_AUTO_APPFW 2 /** -* @brief Internal variable. It can check whether voice control elm is initilaized or not. +* @brief Internal variable. It can check whether voice control elm is initialized or not. */ static unsigned is_vc_elm_initialized = false; @@ -424,7 +424,7 @@ int vc_elm_create_object(Evas_Object *object, vc_elm_h *vc_elm) } if (NULL == vc_elm) { - VC_ELM_LOG_ERR("Invalid parameters detected! (vc_elm_h *) poiter is NULL"); //LCOV_EXCL_LINE + VC_ELM_LOG_ERR("Invalid parameters detected! (vc_elm_h *) pointer is NULL"); //LCOV_EXCL_LINE return VC_ELM_ERROR_INVALID_PARAMETER; } if ((NULL == object) || (!elm_object_widget_check(object))) { @@ -467,11 +467,11 @@ int vc_elm_create_item(Elm_Object_Item *item, vc_elm_h *vc_elm) } if (NULL == vc_elm) { - VC_ELM_LOG_ERR("Invalid parameters detected! (vc_elm_h *) poiter is NULL"); //LCOV_EXCL_LINE + VC_ELM_LOG_ERR("Invalid parameters detected! (vc_elm_h *) pointer is NULL"); //LCOV_EXCL_LINE return VC_ELM_ERROR_INVALID_PARAMETER; } if (NULL == item) { - VC_ELM_LOG_ERR("Invalid parameters detected! (Elm_Object_Item *) poiter is NULL"); //LCOV_EXCL_LINE + VC_ELM_LOG_ERR("Invalid parameters detected! (Elm_Object_Item *) pointer is NULL"); //LCOV_EXCL_LINE *vc_elm = NULL; return VC_ELM_ERROR_INVALID_PARAMETER; } @@ -753,7 +753,7 @@ int vc_elm_get_command_hint_offset(vc_elm_h vc_elm, int *pos_x, int *pos_y) return VC_ELM_ERROR_INVALID_PARAMETER; } if ((NULL == pos_x) || (NULL == pos_y)) { - VC_ELM_LOG_ERR("Invalid position poiters detected!"); //LCOV_EXCL_LINE + VC_ELM_LOG_ERR("Invalid position pointers detected!"); //LCOV_EXCL_LINE return VC_ELM_ERROR_INVALID_PARAMETER; } type = handler->type; diff --git a/src/vc_elm_core.c b/src/vc_elm_core.c index 42ccfc2..b8ceb16 100644 --- a/src/vc_elm_core.c +++ b/src/vc_elm_core.c @@ -95,7 +95,7 @@ const Eina_Hash *_vc_elm_core_get_config_widget_map() } /** - * @brief Structure that wrapps a command with corresponding widget and it's parent + * @brief Structure that wraps a command with corresponding widget and it's parent */ struct Wrapped_Command { const char *cmd; @@ -106,7 +106,7 @@ struct Wrapped_Command { }; /** - * @brief Structure that wrapps a wrapped command with it's command and param + * @brief Structure that wraps a wrapped command with it's command and param */ struct Unwrapped_Command { struct Wrapped_Command *wrap; @@ -974,8 +974,8 @@ static void __elm_widget_foreach_in_tree(Evas_Object *widget, Eina_Bool(*cb)(Eva VC_ELM_LOG_DBG("call subobjects_func, constant_list(%d)", eina_list_count(list)); constant_list = info->get_subobjects_func(widget, info->user_data); } else if (obj_name != NULL && (!strcmp("Elm_Button", obj_name) || !strcmp("Elm_Index", obj_name))) { - /* We dont want to have a tooltip for elm_icon on button */ - /* We dont want to have tooltips for elm_index items */ + /* We don't want to have a tooltip for elm_icon on button */ + /* We don't want to have tooltips for elm_index items */ return; } else if (obj_name != NULL && !strcmp("Elm_List", obj_name)) { VC_ELM_LOG_DBG(":: %s", obj_name); @@ -1453,7 +1453,7 @@ static void __vc_add_commands() g_wrapped_commands = NULL; } - VC_ELM_LOG_DBG("currene objects(%d)", eina_list_count(g_current_ui_objects)); + VC_ELM_LOG_DBG("current objects(%d)", eina_list_count(g_current_ui_objects)); EINA_LIST_FOREACH(g_current_ui_objects, _l, obj) { struct vc_elm_core_widget_info *info = NULL; const char *obj_name = _get_ui_object_name(obj); @@ -2331,7 +2331,7 @@ int _vc_elm_core_read_xml_data() root = main_node->xmlChildrenNode; while (root != NULL) { - VC_ELM_LOG_DBG("Root nodes mames %s", root->name); + VC_ELM_LOG_DBG("Root nodes names %s", root->name); if (0 == xmlStrcmp(root->name, XML_CAST VC_ELM_TAG_BASE_NAME)) { cur = root->xmlChildrenNode; do { diff --git a/src/vc_elm_core.h b/src/vc_elm_core.h index b241a20..e1e5641 100644 --- a/src/vc_elm_core.h +++ b/src/vc_elm_core.h @@ -96,7 +96,7 @@ typedef struct vc_elm_core_action_info vc_elm_action_info; typedef struct vc_elm_core_widget_info vc_elm_widget_info; /** - * @brief A callback function type to be called to get wigdet subobjects list + * @brief A callback function type to be called to get widget subobjects list */ typedef Eina_List *(*vc_elm_get_subobjects_cb)(const Evas_Object *obj, void *user_data); @@ -337,7 +337,7 @@ const char *_vc_elm_core_get_object_hint(const Evas_Object *obj); /** * @brief vc_elm_core_object_skip_set function marks a widget that hint is not to be set * @param obj pointer to widget - * @return EINA_TRUE if succesful or EINA_FALSE otherwise + * @return EINA_TRUE if successful or EINA_FALSE otherwise */ Eina_Bool _vc_elm_core_set_skip_object(Evas_Object *obj); @@ -416,14 +416,14 @@ Eina_Bool _vc_elm_core_set_object_hint_direction(Evas_Object *obj, vc_elm_direct * @brief vc_elm_core_object_hint_direction_get function gets tooltip's direction * @param obj pointer to widget * @param direction direction of the tooltip - * @return EINA_TRUE if successfull, EINA_FALSE otherwise + * @return EINA_TRUE if successful, EINA_FALSE otherwise */ Eina_Bool _vc_elm_core_get_object_hint_direction(Evas_Object *obj, vc_elm_direction_e *direction); /** * @brief vc_elm_core_object_hint_direction_del function unsets tooltip's direction * @param obj pointer to widget - * @return EINA_TRUE if successfull, EINA_FALSE otherwise + * @return EINA_TRUE if successful, EINA_FALSE otherwise */ Eina_Bool _vc_elm_core_del_object_hint_direction(Evas_Object *obj); diff --git a/src/vc_elm_core_default_widgets.c b/src/vc_elm_core_default_widgets.c index ad453d1..76e04fe 100644 --- a/src/vc_elm_core_default_widgets.c +++ b/src/vc_elm_core_default_widgets.c @@ -70,7 +70,7 @@ static void __set_tooltips_position_on_visible_items(Evas_Object *parent, Elm_Ob /** * @brief Function for scrolling elementary object - * @param Scrolable Evas_Object + * @param Scrollable Evas_Object * @param enumeration value of amount of scroll * @param enumeration value of turn * @param enumeration value of direction @@ -1025,11 +1025,11 @@ static void __colorselector_value_activator_func(Evas_Object *obj, void *data, c } /** - * @brief Function that analyse layout for color objects. + * @brief Function that analyze layout for color objects. */ static void __sub_layout_inspect(Eina_List *ret, Evas_Object *widget) { - /*Temporary fix for pallete without tooltips*/ + /*Temporary fix for palette without tooltips*/ const char *colors[] = {"pink", "violet", "purple", "navy", "blue", "cyan", "green", "lime", "yellow", "red"}; const Eina_List *l = NULL; Evas_Object *obj = NULL; diff --git a/src/vc_elm_tooltip.h b/src/vc_elm_tooltip.h index 63912b3..5f28283 100644 --- a/src/vc_elm_tooltip.h +++ b/src/vc_elm_tooltip.h @@ -57,7 +57,7 @@ void _vc_elm_turn_off_tooltips(); void _vc_elm_add_tooltip(Evas_Object *obj, const char *text); /** - * @brief Function that recalculates postitons of all the visible tooltips + * @brief Function that recalculates positions of all the visible tooltips * and shows them */ void _vc_elm_relayout_and_show_tooltips(); diff --git a/src/vc_elm_widget_wrapper.c b/src/vc_elm_widget_wrapper.c index 451bd9d..0f2e9aa 100644 --- a/src/vc_elm_widget_wrapper.c +++ b/src/vc_elm_widget_wrapper.c @@ -271,7 +271,7 @@ static void __vc_service_state_changed_cb(vc_service_state_e previous, vc_servic static void __vc_error_cb(vc_error_e reason, void *user_data) { (void)user_data; - VC_ELM_LOG_ERR("VC Error occured : %d", reason); + VC_ELM_LOG_ERR("VC Error occurred : %d", reason); } static void __vc_result_cb(vc_result_event_e event, vc_cmd_list_h vc_cmd_list, const char *result, void *user_data) -- 2.7.4 From fdb8bd562df812b53d2a07d522b2fa4b9b39a7d7 Mon Sep 17 00:00:00 2001 From: Wonnam Jang Date: Wed, 12 Sep 2018 10:50:55 +0900 Subject: [PATCH 05/16] Fix build warning Change-Id: Ie5d9c9646f1a98b7b8f8d42b86212fb1b75ec31e Signed-off-by: Wonnam Jang --- src/vc_elm_widget_wrapper.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/vc_elm_widget_wrapper.c b/src/vc_elm_widget_wrapper.c index 0f2e9aa..0348379 100644 --- a/src/vc_elm_widget_wrapper.c +++ b/src/vc_elm_widget_wrapper.c @@ -86,6 +86,7 @@ static void __vc_widget_send_current_command_group_cb(vc_cmd_list_h *vc_group, v static void __start_initialize_thread(void *data, Ecore_Thread *thread) { (void)data; + (void)thread; char *lang = NULL; if (vcw.initialized) { @@ -119,6 +120,9 @@ static void __start_initialize_thread(void *data, Ecore_Thread *thread) static void __end_initialize_thread(void *data, Ecore_Thread *thread) { + (void)data; + (void)thread; + VC_ELM_LOG_ERR("[SUCCESS] End initialize thread"); } -- 2.7.4 From 0a9aef125baf7602ddfc8a3400de67496e5d9f32 Mon Sep 17 00:00:00 2001 From: "sooyeon.kim" Date: Wed, 10 Oct 2018 17:11:02 +0900 Subject: [PATCH 06/16] Change ecore_wl API Change-Id: I28464d2b3e0300eb5b669999a828e0ee3d523bab Signed-off-by: sooyeon.kim --- src/vc_elm_efl_dump.c | 8 ++++++-- src/vc_elm_efl_dump.h | 1 + 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/vc_elm_efl_dump.c b/src/vc_elm_efl_dump.c index bc8a5fb..f172721 100644 --- a/src/vc_elm_efl_dump.c +++ b/src/vc_elm_efl_dump.c @@ -863,6 +863,8 @@ ea_object_dump_full_list_get(Eina_Bool exclude_unfocusable_text) ecore_wl_sync(); + Ecore_Wl2_Display* wl2_display = ecore_wl2_connected_display_get(NULL); + if (EINA_TRUE == g_set_geometry) { util_mgr->x = g_geo_x; util_mgr->y = g_geo_y; @@ -871,7 +873,7 @@ ea_object_dump_full_list_get(Eina_Bool exclude_unfocusable_text) } else { util_mgr->x = 0; util_mgr->y = 0; - ecore_wl_screen_size_get(&util_mgr->w, &util_mgr->h); + ecore_wl2_display_screen_size_get(wl2_display, &util_mgr->w, &util_mgr->h); } _object_tree(util_mgr, 1, exclude_unfocusable_text); @@ -907,7 +909,9 @@ ea_object_dump_text_list_get(Eina_Bool exclude_unfocusable_text) ecore_wl_sync(); util_mgr->x = 0; util_mgr->y = 0; - ecore_wl_screen_size_get(&util_mgr->w, &util_mgr->h); + + Ecore_Wl2_Display* wl2_display = ecore_wl2_connected_display_get(NULL); + ecore_wl2_display_screen_size_get(wl2_display, &util_mgr->w, &util_mgr->h); _object_tree(util_mgr, 2, exclude_unfocusable_text); } diff --git a/src/vc_elm_efl_dump.h b/src/vc_elm_efl_dump.h index 27ecd64..576341e 100644 --- a/src/vc_elm_efl_dump.h +++ b/src/vc_elm_efl_dump.h @@ -32,6 +32,7 @@ #include #include +#include #include -- 2.7.4 From 7388740b692bd064391937f2cb3754092bf0b7e3 Mon Sep 17 00:00:00 2001 From: "sooyeon.kim" Date: Wed, 24 Oct 2018 19:16:23 +0900 Subject: [PATCH 07/16] Change ecore_wl to ecore_wl2 Change-Id: I4452a1af2b9963a7d286569cfe945180d2bf6860 Signed-off-by: sooyeon.kim --- src/vc_elm_core.c | 2 +- src/vc_elm_efl_dump.c | 4 ++-- src/vc_elm_efl_dump.h | 1 - 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/vc_elm_core.c b/src/vc_elm_core.c index b8ceb16..4c0fcd5 100644 --- a/src/vc_elm_core.c +++ b/src/vc_elm_core.c @@ -2229,7 +2229,7 @@ static Eina_Bool __idle_enter(void *data) Evas_Object *window = NULL; EINA_LIST_FREE(ecore_evas_list, ee) { evas = ecore_evas_get(ee); - ecore_wl_sync(); + ecore_wl2_sync(); objs = evas_objects_in_rectangle_get(evas, SHRT_MIN, SHRT_MIN, USHRT_MAX, USHRT_MAX, EINA_TRUE, EINA_TRUE); EINA_LIST_FREE(objs, obj) { VC_ELM_LOG_DBG("foreach obj %p", (void*)obj); diff --git a/src/vc_elm_efl_dump.c b/src/vc_elm_efl_dump.c index f172721..237c0d7 100644 --- a/src/vc_elm_efl_dump.c +++ b/src/vc_elm_efl_dump.c @@ -861,7 +861,7 @@ ea_object_dump_full_list_get(Eina_Bool exclude_unfocusable_text) find_popup = 0; skip_text = 0; - ecore_wl_sync(); + ecore_wl2_sync(); Ecore_Wl2_Display* wl2_display = ecore_wl2_connected_display_get(NULL); @@ -906,7 +906,7 @@ ea_object_dump_text_list_get(Eina_Bool exclude_unfocusable_text) evas = ecore_evas_get(ee); util_mgr->evas = evas; - ecore_wl_sync(); + ecore_wl2_sync(); util_mgr->x = 0; util_mgr->y = 0; diff --git a/src/vc_elm_efl_dump.h b/src/vc_elm_efl_dump.h index 576341e..9d168b1 100644 --- a/src/vc_elm_efl_dump.h +++ b/src/vc_elm_efl_dump.h @@ -31,7 +31,6 @@ #define ELM_INTERNAL_API_ARGESFSDFEFC #include -#include #include #include -- 2.7.4 From d7eaa4c38b961d4c7644fe96bddb3977899f9f2a Mon Sep 17 00:00:00 2001 From: "sooyeon.kim" Date: Tue, 21 May 2019 20:43:01 +0900 Subject: [PATCH 08/16] Add gcov package generation feature Change-Id: I5e2f1f0efbd1c29f26a45846d7110186d26dcd8f Signed-off-by: sooyeon.kim --- CMakeLists.txt | 1 - packaging/voice-control-elm.spec | 31 +++++++++++++++++++++++++++++-- 2 files changed, 29 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 49a8f50..d8d30cc 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -25,7 +25,6 @@ pkg_check_modules(pkgs REQUIRED # Build type SET(CMAKE_BUILD_TYPE "Release") SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -O2 -g -D_GNU_SOURCE") -#SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -O2 -g -D_GNU_SOURCE -fprofile-arcs -ftest-coverage") ADD_DEFINITIONS("-DVOICE_LIBDIR=\"${LIBDIR}\"") diff --git a/packaging/voice-control-elm.spec b/packaging/voice-control-elm.spec index 0547c02..30458e3 100644 --- a/packaging/voice-control-elm.spec +++ b/packaging/voice-control-elm.spec @@ -41,14 +41,26 @@ Requires: %{name} = %{version} %description devel voice-control-elm library development headers +%if 0%{?gcov:1} +%package gcov +Summary: voice-control-elm (gcov) +Group: Graphics & UI Framework/Voice Framework +%description gcov +voice-control-elm gcov objects +%endif + %prep %setup -q cp %{SOURCE1001} %{SOURCE1002} . %build export LDFLAGS+="-Wl,--rpath=%{_libdir} -Wl,--hash-style=both -Wl,--as-needed" -#export CXXFLAGS="-fprofile-arcs -ftest-coverage" -#export LDFLAGS+="-Wl,--rpath=%{_libdir} -Wl,--hash-style=both -Wl,--as-needed -lgcov" + +%if 0%{?gcov:1} +export CXXFLAGS="-fprofile-arcs -ftest-coverage" +export LDFLAGS+="-Wl,--rpath=%{_libdir} -Wl,--hash-style=both -Wl,--as-needed -lgcov" +%endif + rm -rf objdir mkdir objdir @@ -77,6 +89,11 @@ MAJORVER=`echo %{version} | awk 'BEGIN {FS="."}{print $1}'` -DSRPOL_DEBUG="0") } +%if 0%{?gcov:1} +mkdir -p gcov-obj +find . -name '*.gcno' -exec cp '{}' gcov-obj ';' +%endif + %install rm -rf %{buildroot} @@ -87,6 +104,11 @@ rm -rf %{buildroot} %clean rm -rf %{buildroot} +%if 0%{?gcov:1} +mkdir -p %{buildroot}%{_datadir}/gcov/obj +install -m 0644 gcov-obj/* %{buildroot}%{_datadir}/gcov/obj +%endif + %post /sbin/ldconfig @@ -111,3 +133,8 @@ mkdir -p %{TZ_SYS_RO_SHARE}/voice %{_includedir}/voice_control_elm.h %{_includedir}/voice_control_elm_private.h %{_libdir}/pkgconfig/%{name}.pc + +%if 0%{?gcov:1} +%files gcov +%{_datadir}/gcov/obj/* +%endif -- 2.7.4 From 13a50d52236d56da390eeabd87efff0670b473a1 Mon Sep 17 00:00:00 2001 From: "sooyeon.kim" Date: Mon, 22 Jul 2019 20:44:39 +0900 Subject: [PATCH 09/16] Fix automatic gcov feature Change-Id: Iccb7059dd28a30768b29dac8ed03a756a961869f Signed-off-by: sooyeon.kim --- packaging/voice-control-elm.spec | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/packaging/voice-control-elm.spec b/packaging/voice-control-elm.spec index 30458e3..5881271 100644 --- a/packaging/voice-control-elm.spec +++ b/packaging/voice-control-elm.spec @@ -54,11 +54,12 @@ voice-control-elm gcov objects cp %{SOURCE1001} %{SOURCE1002} . %build -export LDFLAGS+="-Wl,--rpath=%{_libdir} -Wl,--hash-style=both -Wl,--as-needed" +export LDFLAGS+=" -Wl,--rpath=%{_libdir} -Wl,--hash-style=both -Wl,--as-needed" %if 0%{?gcov:1} -export CXXFLAGS="-fprofile-arcs -ftest-coverage" -export LDFLAGS+="-Wl,--rpath=%{_libdir} -Wl,--hash-style=both -Wl,--as-needed -lgcov" +export CFLAGS+=" -fprofile-arcs -ftest-coverage" +export CXXFLAGS+=" -fprofile-arcs -ftest-coverage" +export LDFLAGS+=" -lgcov" %endif rm -rf objdir @@ -88,6 +89,7 @@ MAJORVER=`echo %{version} | awk 'BEGIN {FS="."}{print $1}'` -DMAJORVER=${MAJORVER} \ -DSRPOL_DEBUG="0") } +(cd objdir && make %{?jobs:-j%jobs}) %if 0%{?gcov:1} mkdir -p gcov-obj @@ -101,14 +103,14 @@ rm -rf %{buildroot} (cd objdir && %make_install) -%clean -rm -rf %{buildroot} - %if 0%{?gcov:1} mkdir -p %{buildroot}%{_datadir}/gcov/obj install -m 0644 gcov-obj/* %{buildroot}%{_datadir}/gcov/obj %endif +%clean +rm -rf %{buildroot} + %post /sbin/ldconfig -- 2.7.4 From 134bab5c5b62a4ecbc491b17aa538c119037aab4 Mon Sep 17 00:00:00 2001 From: sungrae jo Date: Thu, 22 Aug 2019 17:38:51 +0900 Subject: [PATCH 10/16] Remove check type code. Change-Id: I2d672047e71512d802730b82be970e56de0963a3 Signed-off-by: sungrae jo --- src/vc_elm.c | 7 ------- 1 file changed, 7 deletions(-) diff --git a/src/vc_elm.c b/src/vc_elm.c index 69ab635..39b4f82 100644 --- a/src/vc_elm.c +++ b/src/vc_elm.c @@ -499,7 +499,6 @@ int vc_elm_destroy(vc_elm_h vc_elm) { vc_elm_s *handler = NULL; Eina_List *list = NULL; - int type = 0; if (0 != __vc_elm_get_feature_enabled()) { return VC_ELM_ERROR_NOT_SUPPORTED; } @@ -512,12 +511,6 @@ int vc_elm_destroy(vc_elm_h vc_elm) return VC_ELM_ERROR_INVALID_PARAMETER; } handler = (vc_elm_s *)vc_elm; - type = handler->type; - if (!((VC_ELM_TYPE_EVAS_OBJECT == type) || (VC_ELM_TYPE_ITEM == type))) { - VC_ELM_LOG_ERR("Invalid type detected!"); //LCOV_EXCL_LINE - return VC_ELM_ERROR_INVALID_PARAMETER; - } - list = eina_list_data_find_list(g_handlers_list, handler); if (NULL == list) { VC_ELM_LOG_ERR("Bad handler pointer detected!"); //LCOV_EXCL_LINE -- 2.7.4 From 606c11cf5ce73a26a7e6ad3bafa22f619077bf4e Mon Sep 17 00:00:00 2001 From: "sooyeon.kim" Date: Mon, 21 Oct 2019 15:20:53 +0900 Subject: [PATCH 11/16] Fix line coverage script Change-Id: Idfd9ac1ecfcb70c08935db7f5b98252017afd816 Signed-off-by: sooyeon.kim --- packaging/voice-control-elm.spec | 1 + 1 file changed, 1 insertion(+) diff --git a/packaging/voice-control-elm.spec b/packaging/voice-control-elm.spec index 5881271..e6aa681 100644 --- a/packaging/voice-control-elm.spec +++ b/packaging/voice-control-elm.spec @@ -93,6 +93,7 @@ MAJORVER=`echo %{version} | awk 'BEGIN {FS="."}{print $1}'` %if 0%{?gcov:1} mkdir -p gcov-obj +find . -name 'vc_elm_*.gcno' -exec rm {} \; find . -name '*.gcno' -exec cp '{}' gcov-obj ';' %endif -- 2.7.4 From f7031b845d4122c7e1d483ed5e4d6c2782af1c3a Mon Sep 17 00:00:00 2001 From: "wn.jang" Date: Fri, 6 Dec 2019 17:27:36 +0900 Subject: [PATCH 12/16] Fix url link properly Change-Id: I1352907d34405a9a2f15f18c64e50472cb37901a --- doc/uix_voice_control_elm_doc.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/uix_voice_control_elm_doc.h b/doc/uix_voice_control_elm_doc.h index f9ee1e2..f9f3e58 100644 --- a/doc/uix_voice_control_elm_doc.h +++ b/doc/uix_voice_control_elm_doc.h @@ -122,7 +122,7 @@ * It is recommended to design feature related codes in your application for reliability.
* You can check if a device supports the related features for this API by using @ref CAPI_SYSTEM_SYSTEM_INFO_MODULE, thereby controlling the procedure of your application.
* To ensure your application is only running on the device with specific features, please define the features in your manifest file using the manifest editor in the SDK.
- * More details on featuring your application can be found from Feature Element. + * More details on featuring your application can be found from Feature Element. */ -- 2.7.4 From fcfdd10dc887385db1029091e92d72814186127e Mon Sep 17 00:00:00 2001 From: "wn.jang" Date: Thu, 27 Feb 2020 13:59:01 +0900 Subject: [PATCH 13/16] Check if return value of evas_ojbect_type_get() is NULL or not Change-Id: Id28b27ea5946bdb39d2d2651d9015347026b009f --- src/vc_elm_core.c | 16 ++++++------ src/vc_elm_efl_dump.c | 68 +++++++++++++++++++++++++-------------------------- src/vc_elm_tools.h | 1 + 3 files changed, 43 insertions(+), 42 deletions(-) diff --git a/src/vc_elm_core.c b/src/vc_elm_core.c index 4c0fcd5..d680763 100644 --- a/src/vc_elm_core.c +++ b/src/vc_elm_core.c @@ -398,7 +398,7 @@ static Eina_Bool _vc_elm_click_matched_object_vt_auto(const char* cmd, int click } else if (1 == click_method) { VC_ELM_LOG_DBG("click method - focus/key"); bool clicked = false; - if (0 != strcmp(evas_object_type_get((Evas_Object*)info->address), "text") && 0 != strcmp(evas_object_type_get((Evas_Object*)info->address), "textblock")) { + if (0 != strcmp(EVAS_OBJECT_TYPE_GET((Evas_Object*)info->address), "text") && 0 != strcmp(EVAS_OBJECT_TYPE_GET((Evas_Object*)info->address), "textblock")) { VC_ELM_LOG_DBG("Click event"); if (EINA_TRUE == elm_object_focus_get((Evas_Object*)info->address)) { VC_ELM_LOG_DBG("Already focused"); @@ -530,7 +530,7 @@ Eina_Bool _recognize_command(const char *cmd, const char *param1, const char *pa VC_ELM_LOG_DBG("action(%s)", &cmd[strlen(temp) + 1]); } found->cmd = temp; - VC_ELM_LOG_DBG("unwrapping %s %s for %s(%s)", param1, param2, _get_ui_object_name(found->obj), evas_object_type_get(found->obj)); + VC_ELM_LOG_DBG("unwrapping %s %s for %s(%s)", param1, param2, _get_ui_object_name(found->obj), EVAS_OBJECT_TYPE_GET(found->obj)); found->unwrap_callback(found, action, param2); return EINA_TRUE; @@ -891,7 +891,7 @@ static Eina_List *__get_ctxpopup_objects_of_visible_items(Evas_Object *widget) do { Evas_Object *ee = eina_list_data_get(tmp_list); eina_hash_foreach(command_item_map, __item_item_map_foreach, ee); - VC_ELM_LOG_DBG("ctx popup object(%p)(%s)", ee, evas_object_type_get(ee)); + VC_ELM_LOG_DBG("ctx popup object(%p)(%s)", ee, EVAS_OBJECT_TYPE_GET(ee)); VC_ELM_LOG_DBG("cmd(%s) hint(%s)", evas_object_data_get(ee, VC_ELM_CMD_DATA_KEY), evas_object_data_get(ee, VC_ELM_HINT_DATA_KEY)); if (evas_object_data_get(ee, VC_ELM_CMD_DATA_KEY) || evas_object_data_get(ee, VC_ELM_HINT_DATA_KEY)) ret = eina_list_append(ret, (void *)ee); @@ -949,7 +949,7 @@ static void __elm_widget_foreach_in_tree(Evas_Object *widget, Eina_Bool(*cb)(Eva { Eina_Bool visible = evas_object_visible_get(widget); - VC_ELM_LOG_DBG("IS visible (%p)(%s)(%s), visible(%d)", widget, _get_ui_object_name(widget), evas_object_type_get(widget), visible); + VC_ELM_LOG_DBG("IS visible (%p)(%s)(%s), visible(%d)", widget, _get_ui_object_name(widget), EVAS_OBJECT_TYPE_GET(widget), visible); if (visible) { Eina_List *list = NULL; const Eina_List *constant_list = NULL; @@ -1084,7 +1084,7 @@ static int __is_hiding_widget(Evas_Object *obj, Evas_Coord x, Evas_Coord y, Evas evas_object_geometry_get(above_obj, &my_x, &my_y, &my_w, &my_h); - if (strstr(evas_object_type_get(above_obj), "Elm") && !strstr(evas_object_type_get(above_obj), "Elm_Win") && evas_object_visible_get(above_obj) && ((my_x >= 0) && (my_y >= 0) && (my_w > 0) && (my_h > 0))) { + if (strstr(EVAS_OBJECT_TYPE_GET(above_obj), "Elm") && !strstr(EVAS_OBJECT_TYPE_GET(above_obj), "Elm_Win") && evas_object_visible_get(above_obj) && ((my_x >= 0) && (my_y >= 0) && (my_w > 0) && (my_h > 0))) { if ((my_x <= x) && (my_y <= y) && ((my_x + my_w) >= (x + w)) && ((my_y + my_h) >= (y + h))) return 1; } @@ -1379,7 +1379,7 @@ static int __vc_add_commands_for_automode_vt_auto() } } VC_ELM_LOG_DBG("info(%s) parent(%s) grand(%s)", elm_widget_type_get((Evas_Object*)info->address), (!parent) ? "NULL" : elm_widget_type_get((Evas_Object*)parent->address), widget_type); - // VC_ELM_LOG_DBG("info(%s) parent(%s) grand(%s)", evas_object_type_get((Evas_Object*)info->address), evas_object_type_get((Evas_Object*)parent->address), evas_object_type_get((Evas_Object*)grand->address)); + // VC_ELM_LOG_DBG("info(%s) parent(%s) grand(%s)", EVAS_OBJECT_TYPE_GET((Evas_Object*)info->address), EVAS_OBJECT_TYPE_GET((Evas_Object*)parent->address), EVAS_OBJECT_TYPE_GET((Evas_Object*)grand->address)); if (NULL != widget_type && (!strcmp(widget_type, "Elm_Genlist") || !strcmp(widget_type, "Elm_Gengrid") || !strcmp(widget_type, "Elm_List"))) { int x = info->geometry_info.x; @@ -1696,7 +1696,7 @@ static void __unwrap_universal_item_command(struct Wrapped_Command *wrapper, con if (NULL != item) { parent = elm_object_parent_widget_get(_vc_elm_core_get_evas_object(item)); - VC_ELM_LOG_DBG("Parent evas_object(%s)(%s)", _get_ui_object_name(parent), evas_object_type_get(parent)); + VC_ELM_LOG_DBG("Parent evas_object(%s)(%s)", _get_ui_object_name(parent), EVAS_OBJECT_TYPE_GET(parent)); while (NULL != parent) { if (0 == strcmp(_get_ui_object_name(parent), "Elm_Genlist")) { evas_object_geometry_get(_vc_elm_core_get_evas_object(item), &x, &y, &w, &h); @@ -2234,7 +2234,7 @@ static Eina_Bool __idle_enter(void *data) EINA_LIST_FREE(objs, obj) { VC_ELM_LOG_DBG("foreach obj %p", (void*)obj); window = elm_object_top_widget_get(obj); - if (window && !strcmp(evas_object_type_get(window), "Elm_Win") && EINA_TRUE == elm_win_focus_get(window)) { + if (window && !strcmp(EVAS_OBJECT_TYPE_GET(window), "Elm_Win") && EINA_TRUE == elm_win_focus_get(window)) { VC_ELM_LOG_DBG("NEW Focused g_default %ud", elm_win_xwindow_get(window)); g_default_window = window; } diff --git a/src/vc_elm_efl_dump.c b/src/vc_elm_efl_dump.c index 237c0d7..35e6cb3 100644 --- a/src/vc_elm_efl_dump.c +++ b/src/vc_elm_efl_dump.c @@ -101,7 +101,7 @@ evas_object_is_visible_get(Evas_Object *obj) static Eina_Bool evas_object_type_match(const Evas_Object *obj, const char *type) { - int ret = strcmp(evas_object_type_get(obj), type); + int ret = strcmp(EVAS_OBJECT_TYPE_GET(obj), type); if (!ret) return EINA_TRUE; return EINA_FALSE; @@ -250,15 +250,15 @@ _obj_tree_items(Ea_Util_Mgr *util_mgr, Evas_Object *obj, Object_Info *parent) object_info->rgb_info.b = b; object_info->rgb_info.a = a; } else { - object_info->type = calloc(1, strlen(evas_object_type_get(obj)) + 1); - strncpy(object_info->type, evas_object_type_get(obj), strlen(evas_object_type_get(obj)) + 1); + object_info->type = calloc(1, strlen(EVAS_OBJECT_TYPE_GET(obj)) + 1); + strncpy(object_info->type, EVAS_OBJECT_TYPE_GET(obj), strlen(EVAS_OBJECT_TYPE_GET(obj)) + 1); } smart_parent_obj = evas_object_smart_parent_get(obj); // image info save - if (!strcmp(evas_object_type_get(obj), "elm_icon") || - !strcmp(evas_object_type_get(obj), "elm_image")) { + if (!strcmp(EVAS_OBJECT_TYPE_GET(obj), "elm_icon") || + !strcmp(EVAS_OBJECT_TYPE_GET(obj), "elm_image")) { elm_image_file_get(obj, &file, &key); evas_object_data_set(obj, "image_name", file); } @@ -311,9 +311,9 @@ _obj_tree_items(Ea_Util_Mgr *util_mgr, Evas_Object *obj, Object_Info *parent) } text = NULL; - if (!strcmp(evas_object_type_get(obj), "text")) + if (!strcmp(EVAS_OBJECT_TYPE_GET(obj), "text")) text = eina_stringshare_add(evas_object_text_text_get(obj)); - else if (!strcmp(evas_object_type_get(obj), "textblock")) { + else if (!strcmp(EVAS_OBJECT_TYPE_GET(obj), "textblock")) { ret = evas_object_textblock_text_markup_get(obj); temp = evas_textblock_text_markup_to_utf8(obj, ret); text = eina_stringshare_add(temp); @@ -339,9 +339,9 @@ next: static Eina_Bool _is_clickable_object(Evas_Object *obj) { - if (!strcmp(evas_object_type_get(obj), "elm_win") || !strcmp(evas_object_type_get(obj), "elm_naviframe") || !strcmp(evas_object_type_get(obj), "elm_label") - || !strcmp(evas_object_type_get(obj), "elm_ctxpopup") || !strcmp(evas_object_type_get(obj), "elm_popup")) { - VC_ELM_LOG_DUMP("Not clickable object(%s)", evas_object_type_get(obj)); + if (!strcmp(EVAS_OBJECT_TYPE_GET(obj), "elm_win") || !strcmp(EVAS_OBJECT_TYPE_GET(obj), "elm_naviframe") || !strcmp(EVAS_OBJECT_TYPE_GET(obj), "elm_label") + || !strcmp(EVAS_OBJECT_TYPE_GET(obj), "elm_ctxpopup") || !strcmp(EVAS_OBJECT_TYPE_GET(obj), "elm_popup")) { + VC_ELM_LOG_DUMP("Not clickable object(%s)", EVAS_OBJECT_TYPE_GET(obj)); return EINA_FALSE; } @@ -354,7 +354,7 @@ static Eina_Bool _is_descendant_of_list(Object_Info *object_info) while (NULL != parent_info) { const char* widget_type = elm_widget_type_get((const Evas_Object*)(parent_info->address)); if (NULL != widget_type) { - VC_ELM_LOG_DUMP("[DEBUG] object_type(%s), widget_type(%s)", evas_object_type_get((Evas_Object*)(parent_info->address)), widget_type); + VC_ELM_LOG_DUMP("[DEBUG] object_type(%s), widget_type(%s)", EVAS_OBJECT_TYPE_GET((Evas_Object*)(parent_info->address)), widget_type); if (!strcmp(widget_type, "Elm_Genlist") || !strcmp(widget_type, "Elm_Gengrid") || !strcmp(widget_type, "Elm_List") || !strcmp(widget_type, "Elm_Ctxpopup") || !strcmp(widget_type, "Elm_Index")) return EINA_TRUE; } @@ -369,7 +369,7 @@ static Eina_Bool _is_descendant_of_ctxpopup(Object_Info *object_info) while (NULL != parent_info) { const char* widget_type = elm_widget_type_get((const Evas_Object*)(parent_info->address)); if (NULL != widget_type) { - VC_ELM_LOG_DUMP("[DEBUG] object_type(%s), widget_type(%s)", evas_object_type_get((Evas_Object*)(parent_info->address)), widget_type); + VC_ELM_LOG_DUMP("[DEBUG] object_type(%s), widget_type(%s)", EVAS_OBJECT_TYPE_GET((Evas_Object*)(parent_info->address)), widget_type); if (!strcmp(widget_type, "Elm_Ctxpopup")) return EINA_TRUE; } @@ -384,7 +384,7 @@ static Eina_Bool _is_descendant_of_toolbar(Object_Info *object_info) while (NULL != parent_info) { const char* widget_type = elm_widget_type_get((const Evas_Object*)(parent_info->address)); if (NULL != widget_type) { - VC_ELM_LOG_DUMP("[DEBUG] object_type(%s), widget_type(%s)", evas_object_type_get((Evas_Object*)(parent_info->address)), widget_type); + VC_ELM_LOG_DUMP("[DEBUG] object_type(%s), widget_type(%s)", EVAS_OBJECT_TYPE_GET((Evas_Object*)(parent_info->address)), widget_type); if (!strcmp(widget_type, "Elm_Toolbar")) return EINA_TRUE; } @@ -434,11 +434,11 @@ _obj_tree_items_exclude_unfocusable_text(Ea_Util_Mgr *util_mgr, Evas_Object *obj Object_Info *object_info = NULL; char* temp = NULL; - VC_ELM_LOG_DUMP("[%d] Object(%p)(%s), text(%s)(%s)", cnt, obj, evas_object_type_get(obj), (!evas_object_text_text_get(obj)) ? " " : evas_object_text_text_get(obj), !elm_atspi_accessible_name_get(obj) ? " " : elm_atspi_accessible_name_get(obj)); + VC_ELM_LOG_DUMP("[%d] Object(%p)(%s), text(%s)(%s)", cnt, obj, EVAS_OBJECT_TYPE_GET(obj), (!evas_object_text_text_get(obj)) ? " " : evas_object_text_text_get(obj), !elm_atspi_accessible_name_get(obj) ? " " : elm_atspi_accessible_name_get(obj)); // visible check if (!evas_object_is_visible_get(obj)) { - VC_ELM_LOG_DUMP(" [%d] Object(%s) : Invisible)", cnt, evas_object_type_get(obj)); + VC_ELM_LOG_DUMP(" [%d] Object(%s) : Invisible)", cnt, EVAS_OBJECT_TYPE_GET(obj)); return; } @@ -450,7 +450,7 @@ _obj_tree_items_exclude_unfocusable_text(Ea_Util_Mgr *util_mgr, Evas_Object *obj } if (find_popup) { - VC_ELM_LOG_DUMP(" [%d] Object(%s) : Find_popup", cnt, evas_object_type_get(obj)); + VC_ELM_LOG_DUMP(" [%d] Object(%s) : Find_popup", cnt, EVAS_OBJECT_TYPE_GET(obj)); return; } @@ -471,14 +471,14 @@ _obj_tree_items_exclude_unfocusable_text(Ea_Util_Mgr *util_mgr, Evas_Object *obj goto next; } - if (!strcmp(evas_object_type_get(obj), "text") || !strcmp(evas_object_type_get(obj), "textblock")) { + if (!strcmp(EVAS_OBJECT_TYPE_GET(obj), "text") || !strcmp(EVAS_OBJECT_TYPE_GET(obj), "textblock")) { if (!parent_widget_focusable && !list_type) { VC_ELM_LOG_DUMP("## parent_widget_focusable(%d), list_type(%d)", parent_widget_focusable, list_type); goto next; } if (skip_text) { skip_text = 0; - VC_ELM_LOG_DUMP(" [%d] Object(%s) : Skip_text", cnt, evas_object_type_get(obj)); + VC_ELM_LOG_DUMP(" [%d] Object(%s) : Skip_text", cnt, EVAS_OBJECT_TYPE_GET(obj)); return; } } @@ -530,15 +530,15 @@ _obj_tree_items_exclude_unfocusable_text(Ea_Util_Mgr *util_mgr, Evas_Object *obj object_info->rgb_info.b = b; object_info->rgb_info.a = a; } else { - object_info->type = calloc(1, strlen(evas_object_type_get(obj)) + 1); - strncpy(object_info->type, evas_object_type_get(obj), strlen(evas_object_type_get(obj)) + 1); + object_info->type = calloc(1, strlen(EVAS_OBJECT_TYPE_GET(obj)) + 1); + strncpy(object_info->type, EVAS_OBJECT_TYPE_GET(obj), strlen(EVAS_OBJECT_TYPE_GET(obj)) + 1); } smart_parent_obj = evas_object_smart_parent_get(obj); // image info save - if (!strcmp(evas_object_type_get(obj), "elm_icon") || - !strcmp(evas_object_type_get(obj), "elm_image")) { + if (!strcmp(EVAS_OBJECT_TYPE_GET(obj), "elm_icon") || + !strcmp(EVAS_OBJECT_TYPE_GET(obj), "elm_image")) { elm_image_file_get(obj, &file, &key); evas_object_data_set(obj, "image_name", file); } @@ -592,9 +592,9 @@ _obj_tree_items_exclude_unfocusable_text(Ea_Util_Mgr *util_mgr, Evas_Object *obj text = NULL; if (0 == vc_elm_efl_dump_is_vt_auto_enabled()) { - if (!strcmp(evas_object_type_get(obj), "text")) + if (!strcmp(EVAS_OBJECT_TYPE_GET(obj), "text")) text = eina_stringshare_add(evas_object_text_text_get(obj)); - else if (!strcmp(evas_object_type_get(obj), "textblock")) { + else if (!strcmp(EVAS_OBJECT_TYPE_GET(obj), "textblock")) { ret = evas_object_textblock_text_markup_get(obj); temp = evas_textblock_text_markup_to_utf8(obj, ret); text = eina_stringshare_add(temp); @@ -605,10 +605,10 @@ _obj_tree_items_exclude_unfocusable_text(Ea_Util_Mgr *util_mgr, Evas_Object *obj } } } else { - if (!strcmp(evas_object_type_get(obj), "text") && EINA_TRUE == _is_descendant_of_list(object_info)) { + if (!strcmp(EVAS_OBJECT_TYPE_GET(obj), "text") && EINA_TRUE == _is_descendant_of_list(object_info)) { text = eina_stringshare_add(evas_object_text_text_get(obj)); VC_ELM_LOG_DUMP("####### [DEBUG] text(%s), atspi_text(%s)", text, elm_atspi_accessible_name_get(obj)); - } else if (!strcmp(evas_object_type_get(obj), "textblock") && EINA_TRUE == _is_descendant_of_list(object_info)) { + } else if (!strcmp(EVAS_OBJECT_TYPE_GET(obj), "textblock") && EINA_TRUE == _is_descendant_of_list(object_info)) { ret = evas_object_textblock_text_markup_get(obj); temp = evas_textblock_text_markup_to_utf8(obj, ret); text = eina_stringshare_add(temp); @@ -621,15 +621,15 @@ _obj_tree_items_exclude_unfocusable_text(Ea_Util_Mgr *util_mgr, Evas_Object *obj } else if (elm_atspi_accessible_name_get(obj) && EINA_TRUE == object_info->focusable && EINA_TRUE == _is_clickable_object(obj)) { text = elm_atspi_accessible_name_get(obj); VC_ELM_LOG_DUMP("####### [DEBUG] atspi_text(%s)", text); - } else if (elm_atspi_accessible_name_get(obj) && !strcmp(evas_object_type_get(obj), "elm_layout") && EINA_TRUE == _is_descendant_of_toolbar(object_info)) { + } else if (elm_atspi_accessible_name_get(obj) && !strcmp(EVAS_OBJECT_TYPE_GET(obj), "elm_layout") && EINA_TRUE == _is_descendant_of_toolbar(object_info)) { text = elm_atspi_accessible_name_get(obj); VC_ELM_LOG_DUMP("####### [DEBUG] toolbar(%s)", text); } else { if (EINA_FALSE == _has_accessible_name(object_info)) { - if (!strcmp(evas_object_type_get(obj), "text")) { + if (!strcmp(EVAS_OBJECT_TYPE_GET(obj), "text")) { text = eina_stringshare_add(evas_object_text_text_get(obj)); VC_ELM_LOG_DUMP("####### [DEBUG] text(%s), part_name(%s)", text, object_info->part_name); - } else if (!strcmp(evas_object_type_get(obj), "textblock")) { + } else if (!strcmp(EVAS_OBJECT_TYPE_GET(obj), "textblock")) { ret = evas_object_textblock_text_markup_get(obj); temp = evas_textblock_text_markup_to_utf8(obj, ret); text = eina_stringshare_add(temp); @@ -662,7 +662,7 @@ next: _obj_tree_items_exclude_unfocusable_text(util_mgr, child, object_info, parent_widget_focusable, list_type, cnt + 1); if (evas_object_type_match(obj, "elm_popup") || evas_object_type_match(obj, "elm_ctxpopup")) find_popup = 1; } - VC_ELM_LOG_DUMP(" [%d] %s : return", cnt, evas_object_type_get(obj)); + VC_ELM_LOG_DUMP(" [%d] %s : return", cnt, EVAS_OBJECT_TYPE_GET(obj)); } static void @@ -691,9 +691,9 @@ _obj_tree_text_items(Ea_Util_Mgr *util_mgr, Evas_Object *obj) if (is_clip) goto next; text = NULL; - if (!strcmp(evas_object_type_get(obj), "text")) + if (!strcmp(EVAS_OBJECT_TYPE_GET(obj), "text")) text = eina_stringshare_add(evas_object_text_text_get(obj)); - else if (!strcmp(evas_object_type_get(obj), "textblock")) { + else if (!strcmp(EVAS_OBJECT_TYPE_GET(obj), "textblock")) { ret = evas_object_textblock_text_markup_get(obj); temp = evas_textblock_text_markup_to_utf8(obj, ret); text = eina_stringshare_add(temp); @@ -753,10 +753,10 @@ _obj_tree_text_items_exclude_unfocusable_text(Ea_Util_Mgr *util_mgr, Evas_Object } text = NULL; - if (!strcmp(evas_object_type_get(obj), "text")) { + if (!strcmp(EVAS_OBJECT_TYPE_GET(obj), "text")) { if (!parent_widget_focusable) goto next; text = eina_stringshare_add(evas_object_text_text_get(obj)); - } else if (!strcmp(evas_object_type_get(obj), "textblock")) { + } else if (!strcmp(EVAS_OBJECT_TYPE_GET(obj), "textblock")) { if (!parent_widget_focusable) goto next; ret = evas_object_textblock_text_markup_get(obj); temp = evas_textblock_text_markup_to_utf8(obj, ret); diff --git a/src/vc_elm_tools.h b/src/vc_elm_tools.h index 68ff5a4..c746af8 100644 --- a/src/vc_elm_tools.h +++ b/src/vc_elm_tools.h @@ -33,6 +33,7 @@ extern "C" { #define VC_ELM_LOG_ERR(fmt, ...) SLOGE("\033[0;32m" fmt "\033[m", ## __VA_ARGS__) #define VC_ELM_LOG_WARN(fmt, ...) SLOGW("\033[0;32m" fmt "\033[m", ## __VA_ARGS__) +#define EVAS_OBJECT_TYPE_GET(value) (evas_ojbect_type_get(value) ? evas_ojbect_type_get(value) : "#NULL") #ifdef __cplusplus } -- 2.7.4 From d5a3846093f36abc68d9b655ff2cbc6ca0697f14 Mon Sep 17 00:00:00 2001 From: "wn.jang" Date: Wed, 4 Mar 2020 10:30:30 +0900 Subject: [PATCH 14/16] Fix errata Change-Id: I7661a01234b804d8e1a62349f12999f5d62f405c --- src/vc_elm_tools.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/vc_elm_tools.h b/src/vc_elm_tools.h index c746af8..b30410f 100644 --- a/src/vc_elm_tools.h +++ b/src/vc_elm_tools.h @@ -33,7 +33,7 @@ extern "C" { #define VC_ELM_LOG_ERR(fmt, ...) SLOGE("\033[0;32m" fmt "\033[m", ## __VA_ARGS__) #define VC_ELM_LOG_WARN(fmt, ...) SLOGW("\033[0;32m" fmt "\033[m", ## __VA_ARGS__) -#define EVAS_OBJECT_TYPE_GET(value) (evas_ojbect_type_get(value) ? evas_ojbect_type_get(value) : "#NULL") +#define EVAS_OBJECT_TYPE_GET(value) (evas_object_type_get(value) ? evas_object_type_get(value) : "#NULL") #ifdef __cplusplus } -- 2.7.4 From 64a4a849a0b178fe37c4c1db54efdbc1a64cc016 Mon Sep 17 00:00:00 2001 From: "wn.jang" Date: Tue, 15 Sep 2020 11:27:22 +0900 Subject: [PATCH 15/16] Fix defects detected by static analysis tool Change-Id: Icd4d05be3174925c137133e4fee2122a8a31df7c --- src/vc_elm.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/vc_elm.c b/src/vc_elm.c index 39b4f82..eb5343f 100644 --- a/src/vc_elm.c +++ b/src/vc_elm.c @@ -216,7 +216,11 @@ int vc_elm_initialize() /* Initialize voice touch's automode and Register to detect voice touch automode change */ vconf_get_bool(VCONFKEY_VC_VOICE_TOUCH_AUTOMODE, &g_is_vt_automode); - vconf_notify_key_changed(VCONFKEY_VC_VOICE_TOUCH_AUTOMODE, __vc_config_vtauto_changed_cb, NULL); + int ret = vconf_notify_key_changed(VCONFKEY_VC_VOICE_TOUCH_AUTOMODE, __vc_config_vtauto_changed_cb, NULL); + if (0 != ret) { + VC_ELM_LOG_ERR("Fail to notify key changed! vc elm is not initialized"); + return VC_ELM_ERROR_OPERATION_FAILED; + } VC_ELM_LOG_DBG("vc elm is initialized"); return VC_ELM_ERROR_NONE; -- 2.7.4 From bd4a47e5dfc95b4f91111d0a5d177753503b1955 Mon Sep 17 00:00:00 2001 From: "wn.jang" Date: Fri, 4 Dec 2020 16:51:38 +0900 Subject: [PATCH 16/16] Change thread function to ecore timer function MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit dealock log 를 살펴봤는데요, race condition 에 빠진것 같습니다. subthread (5530) 에서 아래 순서로 main thread 가 멈추길 기다리고 있는데요, We looked at dealock log, it seems to be in the race condition. We are waiting for the main thread to stop in the below order in the subthread (5530) [ 433.9562] | -- #0 0xb4b35758 in __pthread_cond_wait () from /usr/lib/libpthread-2.30.so [ 433.9562] | -- #1 0xb552949f in ecore_thread_main_loop_begin () from /usr/lib/libecore.so.1.25.1 [ 433.9562] | -- #2 0xb51acca9 in vc_config_mgr_initialize () from /usr/lib/libvc_setting.so [ 433.9563] | -- #3 0xb4104ce3 in vc_widget_initialize () from /usr/lib/libvc_widget.so main thread 는 sub thread (5530) 에서 잡고 있는 mutex 가 풀리길 기대하고 있어요. The main thread expects the mutex held by the sub thread (5530) to be unlocked. [ 433.9549] | -- #0 0xb4b396c8 in __lll_lock_wait () from /usr/lib/libpthread-2.30.so [ 433.9549] | -- #1 0xb4b30dd4 in __pthread_mutex_lock () from /usr/lib/libpthread-2.30.so [ 433.9549] | -- #2 0xb4104ccf in vc_widget_initialize () from /usr/lib/libvc_widget.so [ 433.9549] | -- #3 0xb5b9214b in _vc_elm_widget_wrapper_initialize () from /usr/lib/libvc-elm.so.0.2.1 [ 433.9549] | -- #4 0xb5ba655d in vc_elm_initialize () from /usr/lib/libvc-elm.so.0.2.1 Change-Id: Icbc6d0551c91d992b7497d3c7a3c902f1bd56d17 --- src/vc_elm_widget_wrapper.c | 34 ++++++++++++++++------------------ 1 file changed, 16 insertions(+), 18 deletions(-) diff --git a/src/vc_elm_widget_wrapper.c b/src/vc_elm_widget_wrapper.c index 0348379..cbc307d 100644 --- a/src/vc_elm_widget_wrapper.c +++ b/src/vc_elm_widget_wrapper.c @@ -34,6 +34,8 @@ struct __voice_control_wrapper_s { }; static struct __voice_control_wrapper_s vcw = {0, 0, 0, 0, 0, 0, 0, 0}; +static Ecore_Timer *g_initialize_timer = NULL; +#define INITIALIZE_INTERVAL_TIME 300 static vc_h g_vc_w; @@ -83,23 +85,25 @@ static void __vc_widget_send_current_command_group_cb(vc_cmd_list_h *vc_group, v VC_ELM_LOG_DBG("SEND CURRENT COMMAND GROUP cb CALLED"); } -static void __start_initialize_thread(void *data, Ecore_Thread *thread) +static Eina_Bool __vc_elm_widget_wrapper_initialize_timer_cb(void *data) { (void)data; - (void)thread; char *lang = NULL; if (vcw.initialized) { VC_ELM_LOG_ERR("already initialized"); - return; + g_initialize_timer = NULL; + return EINA_FALSE; } - int retry_cnt = 0; int ret = -1; - while (retry_cnt < MAX_RETRY_CNT && 0 != (ret = vc_widget_initialize(&g_vc_w))) { + if (0 != (ret = vc_widget_initialize(&g_vc_w))) { VC_ELM_LOG_ERR("Fail to vc_widet_initialize, ret(%d)", ret); - usleep(500000); - retry_cnt++; + if (INITIALIZE_INTERVAL_TIME != (int)ecore_timer_interval_get(g_initialize_timer) * 1000) { + VC_ELM_LOG_INFO("Set initializing timer to %d ms", INITIALIZE_INTERVAL_TIME); + ecore_timer_interval_set(g_initialize_timer, (double)(INITIALIZE_INTERVAL_TIME / 1000)); + } + return EINA_TRUE; } VC_ERROR_CHECK(vc_widget_set_error_cb(g_vc_w, &__vc_error_cb, NULL)); @@ -114,16 +118,8 @@ static void __start_initialize_thread(void *data, Ecore_Thread *thread) vcw.lang = lang; vcw.initialized = 1; - VC_ELM_LOG_ERR("[SUCCESS] vc elm initialized"); - return; -} - -static void __end_initialize_thread(void *data, Ecore_Thread *thread) -{ - (void)data; - (void)thread; - - VC_ELM_LOG_ERR("[SUCCESS] End initialize thread"); + g_initialize_timer = NULL; + return EINA_FALSE; } int _vc_elm_widget_wrapper_initialize() @@ -137,7 +133,9 @@ int _vc_elm_widget_wrapper_initialize() int ret = -1; if (0 != (ret = vc_widget_initialize(&g_vc_w))) { VC_ELM_LOG_ERR("Fail to vc_widet_initialize, ret(%d)", ret); - ecore_thread_run(__start_initialize_thread, __end_initialize_thread, NULL, NULL); + if (g_initialize_timer) + ecore_timer_del(g_initialize_timer); + g_initialize_timer = ecore_timer_add(0.0, __vc_elm_widget_wrapper_initialize_timer_cb, NULL); return ret; } -- 2.7.4