From: DoHyun Pyun Date: Wed, 4 Jul 2018 04:21:41 +0000 (+0900) Subject: Exclude coverage for ag-agent X-Git-Tag: accepted/tizen/unified/20180813.061325~4 X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fconnectivity%2Fbluetooth-agent.git;a=commitdiff_plain;h=f11e80fcd87cefc0f7427f51fcaf18139b6f3d91 Exclude coverage for ag-agent The static functions invoked by external callback operation can be called in gtest. So we exclude it in the coverage. (ag-agent - Line Cov: 87.3%, Func Cov: 100%) Change-Id: I2a0667592b4afbb81aa8e56475812271b6a578dc Signed-off-by: DoHyun Pyun --- diff --git a/ag-agent/bluetooth-ag-agent.c b/ag-agent/bluetooth-ag-agent.c index 609da2e..a1f9d0b 100644 --- a/ag-agent/bluetooth-ag-agent.c +++ b/ag-agent/bluetooth-ag-agent.c @@ -225,6 +225,7 @@ static void __bt_ag_name_owner_changed_cb(GDBusConnection *connection, GVariant *parameters, gpointer user_data); +/* LCOV_EXCL_START */ static void __bt_convert_addr_type_to_rev_string(char *address, unsigned char *addr) { @@ -322,6 +323,7 @@ static int __bt_ag_agent_gdbus_method_send(const char *service, } return BT_HFP_AGENT_ERROR_NONE; } +/* LCOV_EXCL_STOP */ gboolean _bt_ag_agent_emit_signal( GDBusConnection *connection, @@ -340,10 +342,12 @@ gboolean _bt_ag_agent_emit_signal( &error); if (!ret) { if (error != NULL) { + /* LCOV_EXCL_START */ /* dBUS gives error cause */ ERR("D-Bus API failure: errCode[%x], message[%s]", error->code, error->message); g_clear_error(&error); + /* LCOV_EXCL_STOP */ } } INFO_C("Emit Signal done = [%s]", name); @@ -373,6 +377,7 @@ gboolean _bt_ag_agent_emit_property_changed( return ret; } +/* LCOV_EXCL_START */ static void __bt_ag_agent_start_watch(bt_ag_info_t *bt_ag_info) { bt_ag_info->watch_id = g_io_add_watch(bt_ag_info->io_chan, @@ -472,6 +477,7 @@ gboolean __bt_ag_agent_check_dual_hf_condition(const gchar *device_path) return TRUE; } #endif /* TIZEN_SUPPORT_DUAL_HF */ +/* LCOV_EXCL_STOP */ static gboolean __bt_is_phone_locked(int *phone_lock_state) { @@ -483,8 +489,10 @@ static gboolean __bt_is_phone_locked(int *phone_lock_state) ret = vconf_get_int(VCONFKEY_IDLE_LOCK_STATE, phone_lock_state); if (ret != 0) { + /* LCOV_EXCL_START */ ERR("Failed to read [%s]\n", VCONFKEY_IDLE_LOCK_STATE); return FALSE; + /* LCOV_EXCL_STOP */ } FN_END; @@ -554,6 +562,7 @@ static gboolean __bt_get_outgoing_call_condition(int *condition) #endif } +/* LCOV_EXCL_START */ static gboolean __bt_ag_agent_launch_call_app(const char *number) { FN_START; @@ -713,6 +722,7 @@ gboolean _bt_ag_agent_release_call(unsigned int call_id, FN_END; return TRUE; } +/* LCOV_EXCL_STOP */ bt_hfp_agent_error_t _bt_ag_agent_dial_num(const gchar *number, guint flags) { @@ -753,6 +763,7 @@ bt_hfp_agent_error_t _bt_ag_agent_dial_num(const gchar *number, guint flags) goto fail; } + /* LCOV_EXCL_START */ if (callapp_type == BT_VIDEO_CALL) { if (!__bt_ag_agent_make_video_call(number)) { ERR("Problem launching application"); @@ -766,6 +777,7 @@ bt_hfp_agent_error_t _bt_ag_agent_dial_num(const gchar *number, guint flags) goto fail; } } + /* LCOV_EXCL_STOP */ fail: FN_END; @@ -794,6 +806,7 @@ bt_hfp_agent_error_t _bt_ag_agent_dial_memory(unsigned int location) return BT_HFP_AGENT_ERROR_INTERNAL; } + /* LCOV_EXCL_START */ contacts_filter_create(_contacts_speeddial._uri, &filter); if (filter == NULL) @@ -877,8 +890,10 @@ done: FN_END; return error_code; + /* LCOV_EXCL_STOP */ } +/* LCOV_EXCL_START */ bt_hfp_agent_error_t _bt_ag_agent_send_dtmf(const gchar *dtmf, const gchar *path, const gchar *sender) { @@ -933,6 +948,7 @@ gboolean _bt_ag_agent_threeway_call(unsigned int chld_value, FN_END; return TRUE; } +/* LCOV_EXCL_STOP */ bt_hfp_agent_error_t _bt_ag_agent_dial_last_num(void *device) { @@ -959,6 +975,7 @@ bt_hfp_agent_error_t _bt_ag_agent_dial_last_num(void *device) return err_code; } + /* LCOV_EXCL_START */ contacts_filter_create(_contacts_phone_log._uri, &filter); if (filter == NULL) @@ -1126,8 +1143,10 @@ done: FN_END; return err_code; + /* LCOV_EXCL_STOP */ } +/* LCOV_EXCL_START */ bt_hfp_agent_error_t _bt_ag_agent_vendor_cmd(const gchar *cmd, const gchar *path, const gchar *sender) { @@ -1151,6 +1170,7 @@ bt_hfp_agent_error_t _bt_ag_agent_vendor_cmd(const gchar *cmd, FN_END; return ret; } +/* LCOV_EXCL_STOP */ gboolean _bt_ag_agent_get_signal_quality(void *device) { @@ -1159,7 +1179,7 @@ gboolean _bt_ag_agent_get_signal_quality(void *device) FN_START; if (vconf_get_int(VCONFKEY_TELEPHONY_RSSI, &rssi)) { - DBG("VCONFKEY_TELEPHONY_RSSI failed\n"); + DBG("VCONFKEY_TELEPHONY_RSSI failed\n"); /* LCOV_EXCL_LINE */ goto fail; } @@ -1171,9 +1191,11 @@ gboolean _bt_ag_agent_get_signal_quality(void *device) FN_END; return TRUE; fail: + /* LCOV_EXCL_START */ FN_END; _bt_hfp_signal_quality_reply(-1, -1, device); return FALSE; + /* LCOV_EXCL_STOP */ } gboolean _bt_ag_agent_get_battery_status(void *device) @@ -1185,7 +1207,7 @@ gboolean _bt_ag_agent_get_battery_status(void *device) if (vconf_get_int(VCONFKEY_SYSMAN_BATTERY_CHARGE_NOW, &battery_chrg_status)) { - DBG("VCONFKEY_SYSMAN_BATTERY_CHARGE_NOW failed\n"); + DBG("VCONFKEY_SYSMAN_BATTERY_CHARGE_NOW failed\n"); /* LCOV_EXCL_LINE */ goto fail; } @@ -1193,7 +1215,7 @@ gboolean _bt_ag_agent_get_battery_status(void *device) if (vconf_get_int(VCONFKEY_SYSMAN_BATTERY_CAPACITY, &battery_capacity)) { - DBG("VCONFKEY_SYSMAN_BATTERY_CAPACITY failed\n"); + DBG("VCONFKEY_SYSMAN_BATTERY_CAPACITY failed\n"); /* LCOV_EXCL_LINE */ goto fail; } @@ -1205,9 +1227,11 @@ gboolean _bt_ag_agent_get_battery_status(void *device) return TRUE; fail: + /* LCOV_EXCL_START */ _bt_hfp_battery_property_reply(device, -1, -1); FN_END; return FALSE; + /* LCOV_EXCL_STOP */ } gboolean _bt_ag_agent_get_operator_name(void *device) @@ -1217,9 +1241,11 @@ gboolean _bt_ag_agent_get_operator_name(void *device) operator_name = vconf_get_str(VCONFKEY_TELEPHONY_NWNAME); if (NULL == operator_name) { + /* LCOV_EXCL_START */ DBG("vconf_get_str failed"); _bt_hfp_operator_reply(NULL, device); return FALSE; + /* LCOV_EXCL_STOP */ } DBG("operator_name = [%s]", operator_name); @@ -1263,6 +1289,7 @@ gboolean _bt_ag_agent_get_imei_number(void *device) goto fail; } + /* LCOV_EXCL_START */ if (!g_utf8_validate(imei_number, -1, NULL)) { free(imei_number); ERR("get_imei_number : invalid UTF8"); @@ -1274,7 +1301,7 @@ gboolean _bt_ag_agent_get_imei_number(void *device) free(imei_number); FN_END; return TRUE; - + /* LCOV_EXCL_STOP */ fail: _bt_hfp_get_imei_number_reply(NULL, device); FN_END; @@ -1290,15 +1317,19 @@ void _bt_ag_agent_get_manufacturer_name(void *device) ret = system_info_get_platform_string("http://tizen.org/system/manufacturer", &manufacturer_name); if (SYSTEM_INFO_ERROR_NONE != ret) { + /* LCOV_EXCL_START */ ERR("Get manufacturer_name failed : %d", ret); if (NULL != manufacturer_name) free(manufacturer_name); manufacturer_name = g_strdup("Unknown"); + /* LCOV_EXCL_STOP */ } else if (!g_utf8_validate(manufacturer_name, -1, NULL)) { + /* LCOV_EXCL_START */ free(manufacturer_name); manufacturer_name = g_strdup("Unknown"); ERR("get_manufacturer_name : invalid UTF8"); + /* LCOV_EXCL_STOP */ } DBG_SECURE("manufacturer_name = [%s]", manufacturer_name); @@ -1316,16 +1347,19 @@ void _bt_ag_agent_get_imsi(void *device) ERR("tel_get_sim_imsi failed"); goto fail; } + /* LCOV_EXCL_START */ DBG_SECURE("tapi values %s %s %s", imsi.szMcc, imsi.szMnc, imsi.szMsin); _bt_hfp_get_imsi_reply(imsi.szMcc, imsi.szMnc, imsi.szMsin, device); FN_END; return; + /* LCOV_EXCL_STOP */ fail: _bt_hfp_get_imsi_reply(NULL, NULL, NULL, device); FN_END; } +/* LCOV_EXCL_START */ int _bt_ag_agent_registration_status_convert(int result) { switch (result) { @@ -1342,6 +1376,7 @@ int _bt_ag_agent_registration_status_convert(int result) } return result; } +/* LCOV_EXCL_STOP */ void _bt_ag_agent_get_creg_status(void *device) { @@ -1358,6 +1393,7 @@ void _bt_ag_agent_get_creg_status(void *device) ERR("tel_get_property_int failed"); return; } + /* LCOV_EXCL_START */ registration_status = _bt_ag_agent_registration_status_convert(result); @@ -1381,6 +1417,7 @@ void _bt_ag_agent_get_creg_status(void *device) FN_END; return; + /* LCOV_EXCL_STOP */ } void _bt_ag_agent_get_model_name(void *device) @@ -1505,6 +1542,7 @@ gboolean _bt_ag_agent_voice_dial(gboolean activate) return __bt_ag_agent_launch_voice_dial(activate); } +/* LCOV_EXCL_START */ static void __bt_ag_codec_negotiation_info_reset(bt_ag_info_t *hs, gboolean reset) { @@ -1822,6 +1860,7 @@ static void __bt_ag_str2ba(const char *str, bt_addr *ba) for (i = 5; i >= 0; i--, str += 3) ba->b[i] = strtol(str, NULL, 16); } +/* LCOV_EXCL_STOP */ static const char *__bt_ag_state2str(hs_state_t state) { @@ -1861,6 +1900,7 @@ void _bt_convert_addr_string_to_type_rev(unsigned char *addr, } } +/* LCOV_EXCL_START */ static gboolean __bt_ag_check_nval(GIOChannel *chan) { struct pollfd file_desc; @@ -2079,6 +2119,7 @@ static gboolean __bt_ag_sco_server_cb(GIOChannel *chan, return TRUE; } +/* LCOV_EXCL_STOP */ static int __bt_ag_start_sco_server(bt_ag_info_t *hs) { @@ -2137,6 +2178,7 @@ error: return BT_HFP_AGENT_ERROR_INTERNAL; } +/* LCOV_EXCL_START */ void __bt_ag_stop_sco_server(bt_ag_info_t *hs) { DBG("Stop SCO server"); @@ -2317,6 +2359,7 @@ void _bt_ag_set_headset_state(bt_ag_info_t *hs, hs_state_t state) INFO("STATE CHANGED from [%s(%d)] to [%s(%d)]", __bt_ag_state2str(org_state), org_state, __bt_ag_state2str(state), state); } +/* LCOV_EXCL_STOP */ static struct event at_event_callbacks[] = { { "AT+BRSF", _bt_hfp_supported_features }, @@ -2365,6 +2408,7 @@ static struct event at_event_callbacks[] = { int num_of_secure_command = 4; static const char* secure_command[] = {"CLCC", "CLIP", "CPBR", "CCWA"}; +/* LCOV_EXCL_START */ static void __bt_ag_agent_print_at_buffer(char *message, const char *buf) { @@ -2440,6 +2484,7 @@ static int __bt_ag_at_handler(bt_ag_info_t *hs, const char *buf) return -EINVAL; } +/* LCOV_EXCL_STOP */ static int __bt_ag_send_at_valist(bt_ag_info_t *hdset, va_list list, char *list_format) @@ -2547,6 +2592,7 @@ int _bt_ag_send_response(bt_ag_info_t *hs, hfp_state_manager_err_t err) } } +/* LCOV_EXCL_START */ static gboolean __bt_ag_event_handler(GIOChannel *channel, GIOCondition cond, void *user_data) { @@ -2810,6 +2856,7 @@ static gboolean __bt_sco_open_delay_timeout_cb(gpointer user_data) return FALSE; } +/* LCOV_EXCL_STOP */ /* * Service level connection complete @@ -2838,6 +2885,7 @@ void _bt_ag_slconn_complete(bt_ag_info_t *hs) _bt_ag_set_headset_state(hs, HEADSET_STATE_CONNECTED); } +/* LCOV_EXCL_START */ static gboolean __bt_ag_agent_connection_release(bt_ag_info_t *hs) { @@ -4202,6 +4250,7 @@ fail: return BT_HFP_AGENT_ERROR_INTERNAL; } +/* LCOV_EXCL_STOP */ #ifdef TIZEN_FEATURE_BT_MEDIA_ENHANCE void _bt_ag_agent_check_transport_state(void) @@ -4313,6 +4362,8 @@ static void __bt_ag_agent_media_filter_cb(GDBusConnection *connection, FN_END; } #endif + +/* LCOV_EXCL_START */ static void __bt_ag_agent_dbus_init(void) { FN_START; @@ -4363,6 +4414,7 @@ static void __bt_ag_agent_dbus_init(void) FN_END; return; } +/* LCOV_EXCL_STOP */ static uint32_t __bt_ag_agent_get_ag_features(void) { @@ -4400,6 +4452,7 @@ static uint32_t __bt_ag_agent_get_ag_features(void) return ag_features; } +/* LCOV_EXCL_START */ void *__bt_ag_agent_telephony_init(void *arg) { @@ -4479,3 +4532,4 @@ int main(void) INFO_C("### Terminating Bluetooth AG agent"); return 0; } +/* LCOV_EXCL_STOP */ diff --git a/ag-agent/bluetooth-ag-handler.c b/ag-agent/bluetooth-ag-handler.c index 2a761d3..eb3a39f 100644 --- a/ag-agent/bluetooth-ag-handler.c +++ b/ag-agent/bluetooth-ag-handler.c @@ -45,6 +45,7 @@ wbs_options wbs_opts = { .pcm_interface_rate = 0x00, }; +/* LCOV_EXCL_START */ /* AT+BRSF response */ int _bt_hfp_supported_features(bt_ag_info_t *hs, const char *buf) { @@ -130,6 +131,7 @@ static int __bt_check_hdset(bt_ag_info_t *hdset) else return -1; } +/* LCOV_EXCL_STOP */ static int __bt_hfp_cmp(bt_ag_info_t *hs) { @@ -139,6 +141,7 @@ static int __bt_hfp_cmp(bt_ag_info_t *hs) return -1; } +/* LCOV_EXCL_START */ static int __bt_cwa_cmp(bt_ag_info_t *hs) { if (!hs->hfp_active) @@ -224,6 +227,7 @@ int _bt_calling_stopped_indicator(void) return 0; } +/* LCOV_EXCL_STOP */ void _bt_hfp_set_ag_indicator(uint32_t ag_features, const bt_ag_indicators_t *ag_indicators, int rh, @@ -245,6 +249,7 @@ void _bt_hfp_deinitialize(void) ag.er_mode = 3; } +/* LCOV_EXCL_START */ /* Send event indication call from Statemanager module */ bt_hfp_agent_error_t _bt_hfp_event_indicator(int index) { @@ -587,6 +592,7 @@ int _bt_hfp_signal_gain_setting(bt_ag_info_t *hs, const char *buf) return _bt_ag_send_at(hs, "\r\nOK\r\n"); } +/* LCOV_EXCL_STOP */ int _bt_transmit_dtmf_response(void *t_device, bt_hfp_agent_error_t err) @@ -594,6 +600,7 @@ int _bt_transmit_dtmf_response(void *t_device, return _bt_ag_send_response(t_device, err); } +/* LCOV_EXCL_START */ int _bt_hfp_dtmf_tone(bt_ag_info_t *hs, const char *buf) { char tone; @@ -677,6 +684,7 @@ int _bt_hfp_send_vendor_cmd(bt_ag_info_t *hs, return BT_HFP_AGENT_ERROR_NONE; } +/* LCOV_EXCL_STOP */ int _bt_vendor_cmd_response(void *t_device, bt_hfp_agent_error_t err) @@ -684,6 +692,7 @@ int _bt_vendor_cmd_response(void *t_device, return _bt_ag_send_response(t_device, err); } +/* LCOV_EXCL_START */ int _bt_hfp_vendor_cmd(bt_ag_info_t *hs, const char *buf) { DBG("XSAT vendor command"); @@ -719,6 +728,7 @@ int _bt_subscriber_number_indicator(const char *call_num, int type, int service) call_num, type, service); return 0; } +/* LCOV_EXCL_STOP */ int _bt_subscriber_number_response(void *t_device, bt_hfp_agent_error_t err) @@ -726,6 +736,7 @@ int _bt_subscriber_number_response(void *t_device, return _bt_ag_send_response(t_device, err); } +/* LCOV_EXCL_START */ int _bt_hfp_subscriber_number(bt_ag_info_t *hs, const char *buf) { _bt_hfp_subscriber_number_request(hs); @@ -744,6 +755,7 @@ int _bt_call_waiting_indicator(const char *number, int type) number, type); return 0; } +/* LCOV_EXCL_STOP */ int _bt_list_current_calls_response(void *t_device, bt_hfp_agent_error_t err) @@ -751,6 +763,7 @@ int _bt_list_current_calls_response(void *t_device, return _bt_ag_send_response(t_device, err); } +/* LCOV_EXCL_START */ int _bt_hfp_list_current_calls(bt_ag_info_t *hs, const char *buf) { _bt_list_current_calls(hs); @@ -793,6 +806,7 @@ int _bt_hfp_call_waiting_notify(bt_ag_info_t *hs, const char *buf) return _bt_ag_send_at(hs, "\r\nOK\r\n"); } +/* LCOV_EXCL_STOP */ int _bt_operator_selection_response(void *t_device, bt_hfp_agent_error_t err) @@ -842,6 +856,7 @@ int _bt_operator_selection_indicator(int mode, const char *oper) return 0; } +/* LCOV_EXCL_START */ int _bt_hfp_operator_selection(bt_ag_info_t *hs, const char *buf) { if (strlen(buf) < 8) @@ -912,6 +927,7 @@ int _bt_hfp_indicators_activation(bt_ag_info_t *hs, const char *buf) _bt_hfp_set_indicators(&buf[6], hs); return 0; } +/* LCOV_EXCL_STOP */ int _bt_indicators_activation_response(void *t_device, bt_hfp_agent_error_t err) @@ -978,6 +994,7 @@ int _bt_select_phonebook_memory_response(void *t_device, return _bt_ag_send_response(t_device, err); } +/* LCOV_EXCL_START */ int _bt_hfp_select_pb_memory(bt_ag_info_t *hs, const char *buf) { if (strlen(buf) < 8) @@ -999,6 +1016,7 @@ int _bt_hfp_select_pb_memory(bt_ag_info_t *hs, const char *buf) return -EINVAL; } +/* LCOV_EXCL_STOP */ int _bt_read_phonebook_entries_list_response(void *t_device, uint32_t used, @@ -1037,6 +1055,7 @@ int _bt_read_phonebook_entries_response(void *t_device, return _bt_ag_send_response(t_device, err); } +/* LCOV_EXCL_START */ int _bt_read_phonebook_entries_indicator(const char *name, const char *number, uint32_t handle) { @@ -1072,6 +1091,7 @@ int _bt_hfp_read_pb_entries(bt_ag_info_t *hs, const char *buf) return 0; } +/* LCOV_EXCL_STOP */ int _bt_find_phonebook_entries_status_response(void *t_device, bt_hfp_agent_error_t err) @@ -1095,6 +1115,7 @@ int _bt_find_phonebook_entries_status_indicator(uint32_t number_length, return 0; } +/* LCOV_EXCL_START */ int _bt_hfp_find_pb_entires(bt_ag_info_t *hs, const char *buf) { if (strlen(buf) < 8) @@ -1110,6 +1131,7 @@ int _bt_hfp_find_pb_entires(bt_ag_info_t *hs, const char *buf) return 0; } +/* LCOV_EXCL_STOP */ int _bt_supported_character_generic_response(void *t_device, char *character_set_list, @@ -1142,6 +1164,7 @@ int _bt_set_characterset_generic_response(void *t_device, return _bt_ag_send_response(t_device, err); } +/* LCOV_EXCL_START */ int _bt_hfp_select_character_set(bt_ag_info_t *hs, const char *buf) { if (NULL != buf) { @@ -1163,6 +1186,7 @@ int _bt_hfp_select_character_set(bt_ag_info_t *hs, const char *buf) return 0; } +/* LCOV_EXCL_STOP */ int _bt_battery_charge_status_response(void *t_device, int32_t bcs, @@ -1179,6 +1203,7 @@ int _bt_battery_charge_status_response(void *t_device, return _bt_ag_send_response(hs, err); } +/* LCOV_EXCL_START */ int _bt_hfp_get_battery_charge_status(bt_ag_info_t *hs, const char *buf) { if (strlen(buf) < 6) @@ -1197,6 +1222,7 @@ int _bt_hfp_apl_command(bt_ag_info_t *hs, const char *buf) return _bt_ag_send_response(hs, HFP_STATE_MNGR_ERR_NONE); } +/* LCOV_EXCL_STOP */ /* convert signal strength to a RSSI level */ static int __bt_telephony_convert_signal_to_rssi(int signal) @@ -1233,6 +1259,7 @@ int _bt_signal_quality_response(void *t_device, return _bt_ag_send_response(hs, err); } +/* LCOV_EXCL_START */ int _bt_telephony_signal_quality_list_supported_response(void *t_device, bt_hfp_agent_error_t err) { @@ -1258,6 +1285,7 @@ int _bt_hfp_get_signal_quality(bt_ag_info_t *hs, const char *buf) return 0; } +/* LCOV_EXCL_STOP */ int _bt_hfp_get_activity_status_rsp(void *t_device, int status, @@ -1273,6 +1301,7 @@ int _bt_hfp_get_activity_status_rsp(void *t_device, return _bt_ag_send_response(device, err); } +/* LCOV_EXCL_START */ int _bt_hfp_get_activity_status(bt_ag_info_t *device, const char *buf) { if (strlen(buf) < 7) @@ -1290,6 +1319,7 @@ int _bt_hfp_get_activity_status(bt_ag_info_t *device, const char *buf) _bt_get_activity_status(device); return 0; } +/* LCOV_EXCL_STOP */ int _bt_hfp_get_equipment_identity_rsp(void *t_device, char *identity, bt_hfp_agent_error_t err) diff --git a/ag-agent/bluetooth-ag-manager.c b/ag-agent/bluetooth-ag-manager.c index 5ba4477..d68b8e3 100644 --- a/ag-agent/bluetooth-ag-manager.c +++ b/ag-agent/bluetooth-ag-manager.c @@ -154,6 +154,7 @@ static struct { .charset_id = 0 }; +/* LCOV_EXCL_START */ static gboolean __bt_hfp_check_for_callpath(const char *call_path, const char *call_sender) { @@ -214,6 +215,7 @@ static void __bt_hfp_free_call(struct telephony_call *t_call) g_free(t_call->call_sender); g_free(t_call); } +/* LCOV_EXCL_STOP */ static void __bt_hfp_reset_indicators(void) { @@ -326,6 +328,7 @@ void _bt_hfp_deinitialize_telephony_manager(void) _bt_hfp_deinitialize(); } +/* LCOV_EXCL_START */ bt_hfp_agent_error_t _bt_hfp_register_telephony_agent(gboolean register_flag, const char *path_to_register, const char *sender) @@ -436,6 +439,7 @@ static struct telephony_call *__bt_hfp_create_new_call( } return t_call; } +/* LCOV_EXCL_STOP */ gboolean _bt_hfp_is_call_exist(void) { @@ -453,18 +457,21 @@ static struct telephony_call *__bt_hfp_get_call_with_status(int call_status) GSList *temp_list = existing_call_list; if (existing_call_list != NULL) { + /* LCOV_EXCL_START */ while (temp_list != NULL) { struct telephony_call *t_call = temp_list->data; if (t_call->call_status == call_status) return t_call; temp_list = temp_list->next; } + /* LCOV_EXCL_STOP */ } DBG("Existing call list is NULL. So return NULL"); return NULL; } +/* LCOV_EXCL_START */ static bt_hfp_agent_error_t __bt_hfp_modify_indicator( const char *indicator_name, int update_value) @@ -1030,6 +1037,7 @@ int _bt_hfp_set_property_value(const char *property, int value) return ret; } +/* LCOV_EXCL_STOP */ int _bt_hfp_set_property_name(const char *property, const char *operator_name) { @@ -1054,6 +1062,7 @@ int _bt_hfp_set_property_name(const char *property, const char *operator_name) return ret; } +/* LCOV_EXCL_START */ static int __bt_hfp_answer_call(struct telephony_call *t_call) { if (t_call->call_id != 0 && t_call->call_path != NULL && @@ -1065,6 +1074,7 @@ static int __bt_hfp_answer_call(struct telephony_call *t_call) } return -1; } +/* LCOV_EXCL_STOP */ void _bt_hfp_answer_call_request(void *t_device) { @@ -1090,11 +1100,13 @@ void _bt_hfp_answer_call_request(void *t_device) return; } + /* LCOV_EXCL_START */ if (__bt_hfp_answer_call(t_call) < 0) _bt_answer_call_response(t_device, HFP_STATE_MNGR_ERR_AG_FAILURE); else _bt_answer_call_response(t_device, HFP_STATE_MNGR_ERR_NONE); + /* LCOV_EXCL_STOP */ } @@ -1116,7 +1128,7 @@ void _bt_hfp_dial_number_request(const char *dial_number, void *t_device) if (error_code == BT_HFP_AGENT_ERROR_NONE) _bt_dial_number_response(t_device, - HFP_STATE_MNGR_ERR_NONE); + HFP_STATE_MNGR_ERR_NONE); /* LCOV_EXCL_LINE */ else _bt_dial_number_response(t_device, HFP_STATE_MNGR_ERR_AG_FAILURE); @@ -1130,7 +1142,7 @@ void _bt_hfp_dial_number_request(const char *dial_number, void *t_device) return; } - _bt_dial_number_response(t_device, HFP_STATE_MNGR_ERR_AG_FAILURE); + _bt_dial_number_response(t_device, HFP_STATE_MNGR_ERR_AG_FAILURE); /* LCOV_EXCL_LINE */ } @@ -1145,6 +1157,7 @@ void _bt_hfp_update_event_request(int indicator, void *t_device) HFP_STATE_MNGR_ERR_NONE); } +/* LCOV_EXCL_START */ static int __bt_bt_hfp_reject_call(struct telephony_call *t_call) { gboolean ret; @@ -1190,6 +1203,7 @@ static int __bt_hfp_release_conference(void) } return 0; } +/* LCOV_EXCL_STOP */ void _bt_hfp_terminate_call_request(void *t_device) { @@ -1203,12 +1217,14 @@ void _bt_hfp_terminate_call_request(void *t_device) DBG("Find non-idle call"); GSList *temp_call_list = existing_call_list; while (temp_call_list != NULL) { + /* LCOV_EXCL_START */ t_call = temp_call_list->data; if (t_call->call_status == HFP_AGENT_CALL_IDLE) temp_call_list = temp_call_list->next; else break; + /* LCOV_EXCL_STOP */ } } @@ -1219,6 +1235,7 @@ void _bt_hfp_terminate_call_request(void *t_device) return; } + /* LCOV_EXCL_START */ if (__bt_hfp_get_call_with_status(HFP_CALL_STATUS_WAITING) != NULL) { int value = 1; t_error = _bt_ag_agent_threeway_call(value, t_call->call_path, @@ -1244,6 +1261,7 @@ void _bt_hfp_terminate_call_request(void *t_device) HFP_STATE_MNGR_ERR_AG_FAILURE); else _bt_terminate_call_response(t_device, HFP_STATE_MNGR_ERR_NONE); + /* LCOV_EXCL_STOP */ } void _bt_hfp_call_hold_request(const char *t_cmd, void *t_device) @@ -1269,6 +1287,7 @@ void _bt_hfp_call_hold_request(const char *t_cmd, void *t_device) } } + /* LCOV_EXCL_START */ while (t_sender_list != NULL) { sender_info = t_sender_list->data; if (sender_info == NULL) { @@ -1292,6 +1311,7 @@ void _bt_hfp_call_hold_request(const char *t_cmd, void *t_device) _bt_call_hold_response(t_device, HFP_STATE_MNGR_ERR_NONE); else _bt_call_hold_response(t_device, HFP_STATE_MNGR_ERR_AG_FAILURE); + /* LCOV_EXCL_STOP */ } void _bt_hfp_key_press_request(const char *t_key_press, void *t_device) @@ -1369,6 +1389,7 @@ void _bt_hfp_channel_dtmf_request(char t_tone, void *t_device) } } + /* LCOV_EXCL_START */ if (_bt_ag_agent_send_dtmf(tone_buffer, t_call->call_path, t_call->call_sender) != BT_HFP_AGENT_ERROR_NONE) { _bt_transmit_dtmf_response(t_device, @@ -1377,6 +1398,7 @@ void _bt_hfp_channel_dtmf_request(char t_tone, void *t_device) } _bt_transmit_dtmf_response(t_device, HFP_STATE_MNGR_ERR_NONE); + /* LCOV_EXCL_STOP */ } void _bt_hfp_vendor_cmd_request(const char *cmd, @@ -1388,6 +1410,7 @@ void _bt_hfp_vendor_cmd_request(const char *cmd, bt_hfp_agent_error_t error = BT_HFP_AGENT_ERROR_NONE; if (NULL != t_sender_list) { + /* LCOV_EXCL_START */ for (l = t_sender_list; l != NULL; l = l->next) { sender_info = l->data; error = _bt_ag_agent_vendor_cmd(cmd, @@ -1396,6 +1419,7 @@ void _bt_hfp_vendor_cmd_request(const char *cmd, if (error != BT_HFP_AGENT_ERROR_NONE) break; } + /* LCOV_EXCL_STOP */ } if (error != BT_HFP_AGENT_ERROR_NONE) @@ -1408,7 +1432,7 @@ void _bt_hfp_vendor_cmd_request(const char *cmd, void _bt_hfp_subscriber_number_request(void *t_device) { if (ag_subscriber_num != NULL) { - + /* LCOV_EXCL_START */ int t_number = AGENT_NUMBER_TYPE_TELEPHONY; if (ag_subscriber_num[0] == '+' || strncmp( @@ -1417,11 +1441,13 @@ void _bt_hfp_subscriber_number_request(void *t_device) _bt_subscriber_number_indicator(ag_subscriber_num, t_number, AGENT_SUBSCRIBER_SERVICE_VOICE); + /* LCOV_EXCL_STOP */ } _bt_subscriber_number_response(t_device, HFP_STATE_MNGR_ERR_NONE); } +/* LCOV_EXCL_START */ static int __bt_hfp_get_call_status(struct telephony_call *t_call) { switch (t_call->call_status) { @@ -1472,6 +1498,7 @@ static int __bt_hfp_get_call_status(struct telephony_call *t_call) return -1; } } +/* LCOV_EXCL_STOP */ void _bt_list_current_calls(void *t_device) { @@ -1482,6 +1509,7 @@ void _bt_list_current_calls(void *t_device) int index; while (t_call_list != NULL) { + /* LCOV_EXCL_START */ struct telephony_call *t_call = t_call_list->data; t_status = __bt_hfp_get_call_status(t_call); if (t_status >= 0) { @@ -1512,6 +1540,7 @@ void _bt_list_current_calls(void *t_device) t_number); } t_call_list = t_call_list->next; + /* LCOV_EXCL_STOP */ } _bt_list_current_calls_response(t_device, HFP_STATE_MNGR_ERR_NONE); } @@ -1527,6 +1556,7 @@ void _bt_hfp_release_all_calls_by_sender(const char *sender) DBG("sender [%s]", sender); while (temp_list != NULL) { + /* LCOV_EXCL_START */ struct telephony_call *t_call = temp_list->data; if (g_strcmp0(t_call->call_sender, sender) == 0) { @@ -1536,6 +1566,7 @@ void _bt_hfp_release_all_calls_by_sender(const char *sender) temp_list = next_list; } else temp_list = temp_list->next; + /* LCOV_EXCL_STOP */ } } @@ -1582,6 +1613,7 @@ void _bt_hfp_set_indicators(const char *t_command, void *t_device) while (hfp_ag_ind[i].indicator_desc != NULL && str != NULL) { str++; + /* LCOV_EXCL_START */ if ((g_strcmp0(hfp_ag_ind[i].indicator_desc, "call") != 0) && (g_strcmp0(hfp_ag_ind[i].indicator_desc, "callheld") != 0) && (g_strcmp0(hfp_ag_ind[i].indicator_desc, "callsetup") != 0)) { @@ -1597,6 +1629,7 @@ void _bt_hfp_set_indicators(const char *t_command, void *t_device) } str = strchr(str, delims); i++; + /* LCOV_EXCL_STOP */ } _bt_indicators_activation_response(t_device, HFP_STATE_MNGR_ERR_NONE); @@ -1642,6 +1675,7 @@ static int __bt_hfp_get_phonebook_count(const char *path, uint32_t *max_size, return -1; } + /* LCOV_EXCL_START */ ret = g_dbus_proxy_call_sync(g_proxy, "GetPhonebookSizeAt", g_variant_new("(s)", path), @@ -1684,6 +1718,7 @@ static int __bt_hfp_get_phonebook_count(const char *path, uint32_t *max_size, g_object_unref(g_conn); if (g_proxy) g_object_unref(g_proxy); + /* LCOV_EXCL_STOP */ #endif return 0; } @@ -1830,6 +1865,7 @@ static int __bt_hfp_get_phonebook_entries(int start_index, int end_index) return -1; } + /* LCOV_EXCL_START */ ret = g_dbus_proxy_call_sync(g_proxy, "GetPhonebookEntriesAt", g_variant_new("(sii)", agent_pb_store_list[ag_pb_info.path_id], @@ -1879,6 +1915,7 @@ static int __bt_hfp_get_phonebook_entries(int start_index, int end_index) g_object_unref(g_conn); if (g_proxy) g_object_unref(g_proxy); + /* LCOV_EXCL_STOP */ #endif return count; }