-void _wfd_util_check_country_cb(keynode_t *key, void *data)
-{
- __WDS_LOG_FUNC_ENTER__;//LCOV_EXCL_LINE
- wfd_manager_s *manager = (wfd_manager_s*) data;
- int res = 0;
- int plmn = 0;
- char mcc[4] = {0, };
- char *ccode;
- GKeyFile *keyfile = NULL;
- const char *file_path = COUNTRY_CODE_FILE;
- GError *err = NULL;
-
- if (!manager) {
- WDS_LOGE("Invalid parameter");
- return;
- }
-
- res = vconf_get_int(VCONFKEY_TELEPHONY_PLMN, &plmn);
- if (res) {
- WDS_LOGE("Failed to get vconf value for PLMN(%d)", res);
- return;
- }
-
- snprintf(mcc, 4, "%d", plmn);
-
- keyfile = g_key_file_new();
- res = g_key_file_load_from_file(keyfile, file_path, 0, &err);
- if (!res) {
- WDS_LOGE("Failed to load key file(%s)", err->message);
- g_key_file_free(keyfile);
- g_error_free(err);
- return;
- }
-
- ccode = g_key_file_get_string(keyfile, "ccode_map", mcc, &err);
- if (!ccode) {
- WDS_LOGE("Failed to get country code string(%s)", err->message);
- g_key_file_free(keyfile);
- g_error_free(err);
- return;
- }
-
- res = wfd_oem_set_country(manager->oem_ops, ccode);
- if (res < 0)
- WDS_LOGE("Failed to set contry code");
- else
- WDS_LOGD("Succeeded to set country code(%s)", ccode);
-
- g_key_file_free(keyfile);
- g_free(ccode);
-
- __WDS_LOG_FUNC_EXIT__;//LCOV_EXCL_LINE
- return;
-}
-