NULL,
&error);
if (NULL == phn_client_dbus_object) {
+ /* LCOV_EXCL_START */
ERR("phn_dbus_proxy_new_for_bus_sync() Fail(%s)", error->message);
g_error_free(error);
return PHONE_NUMBER_ERROR_SYSTEM;
+ /* LCOV_EXCL_STOP */
}
return PHONE_NUMBER_ERROR_NONE;
err = system_info_get_platform_bool(PHN_FEATURE_TELEPHONY, &is_support);
if (SYSTEM_INFO_ERROR_NONE != err) {
+ /* LCOV_EXCL_START */
DBG("Error system_info_get_platform_bool : %d", err);
return PHONE_NUMBER_ERROR_SYSTEM;
+ /* LCOV_EXCL_STOP */
}
if (is_support)
#endif
ret = _phn_client_dbus_start();
- if (PHONE_NUMBER_ERROR_NONE != ret)
+ if (PHONE_NUMBER_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
ERR("_phn_client_dbus_start() Fail(%d)", ret);
+ /* LCOV_EXCL_STOP */
+ }
return ret;
}
}
if (NULL != error) {
+ /* LCOV_EXCL_START */
ERR("phn_dbus_call_get_location_sync() Fail(%s)", error->message);
g_error_free(error);
free(out_loc);
return PHONE_NUMBER_ERROR_SYSTEM;
+ /* LCOV_EXCL_STOP */
}
if (PHONE_NUMBER_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
ERR("Phonenumber utils error : %d", ret);
free(out_loc);
return ret;
+ /* LCOV_EXCL_STOP */
}
*location = out_loc;
}
if (NULL != error) {
+ /* LCOV_EXCL_START */
ERR("phn_dbus_call_get_number_sync() Fail(%s)", error->message);
g_error_free(error);
free(out_num);
return PHONE_NUMBER_ERROR_SYSTEM;
+ /* LCOV_EXCL_STOP */
}
if (PHONE_NUMBER_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
ERR("Phonenumber utils error : %d", ret);
free(out_num);
return ret;
+ /* LCOV_EXCL_STOP */
}
*formatted_number = out_num;
}
if (NULL != error) {
+ /* LCOV_EXCL_START */
ERR("phn_dbus_call_get_normalized_number_sync() Fail(%s)", error->message);
if (G_DBUS_ERROR_ACCESS_DENIED == error->code)
ret = PHONE_NUMBER_ERROR_PERMISSION_DENIED;
g_error_free(error);
free(out_num);
return ret;
+ /* LCOV_EXCL_STOP */
}
if (PHONE_NUMBER_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
ERR("Phonenumber utils error : %d", ret);
free(out_num);
return ret;
+ /* LCOV_EXCL_STOP */
}
*normalized_number = out_num;
ret = phn_region_data_get_region_str(region, ®ion_str);
if (PHONE_NUMBER_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
ERR("phn_region_data_get_region_str() Fail(%d)", ret);
return ret;
+ /* LCOV_EXCL_STOP */
}
ret = phn_region_data_get_lang_str(lang, &lang_str);
if (PHONE_NUMBER_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
ERR("phn_region_data_get_lang_str() Fail(%d)", ret);
free(region_str);
return ret;
+ /* LCOV_EXCL_STOP */
}
bool exist = phn_region_data_find_match_info(region, lang);
}
ret = phn_get_location_from_number(number, region_str, lang_str, location);
- if (PHONE_NUMBER_ERROR_NONE != ret)
+ if (PHONE_NUMBER_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
ERR("phn_get_location_from_number() Fail(%d)", ret);
+ /* LCOV_EXCL_STOP */
+ }
free(region_str);
free(lang_str);
ret = phn_region_data_get_region_str(region, ®ion_str);
if (PHONE_NUMBER_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
ERR("phn_region_data_get_region_str() Fail(%d)", ret);
return ret;
+ /* LCOV_EXCL_STOP */
}
ret = phn_get_formatted_number(number, region_str, formatted_number);
- if (PHONE_NUMBER_ERROR_NONE != ret)
+ if (PHONE_NUMBER_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
ERR("phn_get_formatted_number() Fail(%d)", ret);
+ /* LCOV_EXCL_STOP */
+ }
free(region_str);
return ret;
int ret = PHONE_NUMBER_ERROR_NONE;
ret = phn_get_normalized_number(number, normalized_number);
- if (PHONE_NUMBER_ERROR_NONE != ret)
+ if (PHONE_NUMBER_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
ERR("phn_get_normalized_number() Fail(%d)", ret);
+ /* LCOV_EXCL_STOP */
+ }
return ret;
}
ret = _dbus_get_location_handler(number, region, lang, &location);
if (PHONE_NUMBER_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
ERR("err ret = %d", ret);
location = strdup("");
+ /* LCOV_EXCL_STOP */
}
phn_dbus_complete_get_location(object, invocation, location, ret);
ret = _dbus_get_number_handler(number, region, &formatted_number);
if (PHONE_NUMBER_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
ERR("err ret = %d", ret);
formatted_number = strdup("");
+ /* LCOV_EXCL_STOP */
}
phn_dbus_complete_get_number(object, invocation, formatted_number, ret);
ret = _dbus_get_normalized_number_handler(number, &normalized_number);
if (PHONE_NUMBER_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
ERR("err ret = %d", ret);
normalized_number = strdup("");
+ /* LCOV_EXCL_STOP */
}
phn_dbus_complete_get_normalized_number(object, invocation, normalized_number, ret);
PHN_DBUS_OBJPATH, &error);
if (FALSE == ret) {
+ /* LCOV_EXCL_START */
ERR("g_dbus_interface_skeleton_export() Fail(%s)", error->message);
g_error_free(error);
+ /* LCOV_EXCL_STOP */
}
}
phnd_utils_start_timeout();
if (0 == id) {
+ /* LCOV_EXCL_START */
ERR("g_bus_own_name() Fail");
return 0;
+ /* LCOV_EXCL_STOP */
}
return id;
int ret;
ret = _phn_get_cc(true, NULL);
if (PHONE_NUMBER_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
ERR("_phn_get_cc() Fail(%d)", ret);
return;
+ /* LCOV_EXCL_STOP */
}
}
cp_list = tel_get_cp_name_list();
if (NULL == cp_list) {
+ /* LCOV_EXCL_START */
ERR("tel_get_cp_name_list() Fail(NULL)");
return PHONE_NUMBER_ERROR_SYSTEM;
+ /* LCOV_EXCL_STOP */
}
while (cp_list[_modem_num])
_tapi_handle = (TapiHandle **)calloc(_modem_num, sizeof(TapiHandle *));
if (NULL == _tapi_handle) {
+ /* LCOV_EXCL_START */
ERR("calloc() Fail");
g_strfreev(cp_list);
return PHONE_NUMBER_ERROR_OUT_OF_MEMORY;
+ /* LCOV_EXCL_STOP */
}
for (i = 0; i < _modem_num; i++) {
_tapi_handle[i] = tel_init(cp_list[i]);
if (NULL == _tapi_handle[i]) {
+ /* LCOV_EXCL_START */
ERR("tel_init() for _tapi_handle[%d] Fail", i);
g_strfreev(cp_list);
return PHONE_NUMBER_ERROR_SYSTEM;
+ /* LCOV_EXCL_STOP */
}
ret = tel_register_noti_event(_tapi_handle[i], TAPI_PROP_NETWORK_PLMN,
_phn_cc_changed_cb, NULL);
if (TAPI_API_SUCCESS != ret) {
+ /* LCOV_EXCL_START */
if (TAPI_API_ACCESS_DENIED == ret) {
ERR("tel_register_noti_event() Fail(%d)", ret);
g_strfreev(cp_list);
g_strfreev(cp_list);
return PHONE_NUMBER_ERROR_SYSTEM;
}
+ /* LCOV_EXCL_STOP */
}
}
if (NULL == _tapi_handle) {
ret = _phn_get_tapi_handle();
if (PHONE_NUMBER_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
ERR("_phn_get_tapi_handle() Fail(%d)", ret);
return ret;
+ /* LCOV_EXCL_STOP */
}
}
ret = tel_get_property_int(_tapi_handle[i], TAPI_PROP_NETWORK_SERVICE_TYPE, &state);
if (TAPI_API_SUCCESS != ret) {
+ /* LCOV_EXCL_START */
if (TAPI_API_ACCESS_DENIED == ret) {
ERR("tel_get_property_int() Fail(%d)", ret);
return PHONE_NUMBER_ERROR_PERMISSION_DENIED;
ERR("tel_get_property_int() Fail(%d)", ret);
return PHONE_NUMBER_ERROR_SYSTEM;
}
+ /* LCOV_EXCL_STOP */
}
if (TAPI_NETWORK_SERVICE_TYPE_UNKNOWN == state
ret = tel_get_property_string(_tapi_handle[i], TAPI_PROP_NETWORK_PLMN, &temp);
if (TAPI_API_SUCCESS != ret) {
+ /* LCOV_EXCL_START */
if (TAPI_API_ACCESS_DENIED == ret) {
ERR("tel_get_property_string() Fail(%d)", ret);
return PHONE_NUMBER_ERROR_PERMISSION_DENIED;
ERR("tel_get_property_string() Fail(%d)", ret);
return PHONE_NUMBER_ERROR_SYSTEM;
}
+ /* LCOV_EXCL_STOP */
}
DBG("temp=[%s] from _tapi_handle[%d]", temp, i);
} while (NULL == temp || '\0' == temp[0]);
if (NULL == temp || '\0' == temp[0]) {
+ /* LCOV_EXCL_START */
ERR("get NETWORK_PLMN Fail");
free(temp);
return PHONE_NUMBER_ERROR_SYSTEM;
+ /* LCOV_EXCL_STOP */
}
if (temp && MCC_LEN < strlen(temp))
}
if (0 == _cc) {
+ /* LCOV_EXCL_START */
ERR("No data for current mcc(%d)", mcc);
free(temp);
return PHONE_NUMBER_ERROR_NO_DATA;
+ /* LCOV_EXCL_STOP */
}
if (out_cc) {
ret = _phn_get_cc(false, &cc);
if (PHONE_NUMBER_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
ERR("_phn_get_cc() Fail(%d)", ret);
return ret;
+ /* LCOV_EXCL_STOP */
}
pnu.GetRegionCodeForCountryCode(cc, ®ion_code);
const PhoneNumberUtil::ErrorType status = pnu.Parse(number, region_code, &pn);
if (PhoneNumberUtil::NO_PARSING_ERROR != status) {
+ /* LCOV_EXCL_START */
ERR("PhoneNumberUtil.Parse() Fail(%d), cc(%d), number(%s), region_code(%s)",
status, cc, number, region_code.c_str());
return PHONE_NUMBER_ERROR_SYSTEM;
+ /* LCOV_EXCL_STOP */
}
pnu.Format(pn, PhoneNumberUtil::E164, &number_e164);
*region_str = g_strdup(strchr(str, '_') + 1);
free(str);
if (SYSTEM_SETTINGS_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
ERR("system_settings_get_value_string() Fail(%d)", ret);
return PHONE_NUMBER_ERROR_NOT_SUPPORTED;
+ /* LCOV_EXCL_STOP */
}
return PHONE_NUMBER_ERROR_NONE;
}
*lang_str = g_strdup(strtok_r(str, "_", &last));
free(str);
if (SYSTEM_SETTINGS_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
ERR("system_settings_get_value_string() Fail(%d)", ret);
return PHONE_NUMBER_ERROR_NOT_SUPPORTED;
+ /* LCOV_EXCL_STOP */
}
return PHONE_NUMBER_ERROR_NONE;
}
static GMainLoop *_main_loop;
+/* LCOV_EXCL_START */
void phnd_daemon_quit()
{
INFO("phonenumber-utils daemon is quit by timeout.");
g_main_loop_quit(_main_loop);
_main_loop = NULL;
}
-
+/* LCOV_EXCL_STOP */
int main(int argc, char **argv)
{