sim_info_id = ctsvc_server_sim_get_info_id_by_sim_slot_no(sim_slot_no);
if (sim_info_id <= 0) {
+ /* LCOV_EXCL_START */
ERR("ctsvc_server_sim_get_info_id_by_sim_slot_no() Fail(%d)", sim_info_id);
return CONTACTS_ERROR_NO_DATA;
+ /* LCOV_EXCL_STOP */
}
snprintf(query, sizeof(query), "DELETE FROM "CTS_TABLE_PHONELOG_STAT
extra_data1, CONTACTS_PLOG_TYPE_EMAIL_RECEIVED, CONTACTS_PLOG_TYPE_EMAIL_SENT);
break;
default:
+ /* LCOV_EXCL_START */
ERR("the operation is not proper (op : %d)", op);
return CONTACTS_ERROR_INVALID_PARAMETER;
+ /* LCOV_EXCL_STOP */
}
ret = ctsvc_begin_trans();
RETVM_IF(ret, ret, "ctsvc_begin_trans() Fail(%d)", ret);
ret = ctsvc_query_exec(query);
if (CONTACTS_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
ERR("ctsvc_query_exec() Fail(%d)", ret);
ctsvc_end_trans(false);
return ret;
+ /* LCOV_EXCL_STOP */
}
ctsvc_set_phonelog_noti();
ret = ctsvc_end_trans(true);
}
static int __ctsvc_db_phone_log_find_person_id(char *number, char *normal_num,
- char *minmatch, int person_id, int *find_number_type)
+ char *minmatch, int person_id, int *find_number_type)
{
int ret;
int find_person_id = -1;
"ON "CTS_TABLE_CONTACTS".contact_id = "CTS_TABLE_DATA".contact_id "
"AND datatype = %d AND is_my_profile = 0 AND deleted = 0 "
"WHERE data4 = ? AND _NUMBER_COMPARE_(data5, ?, NULL, NULL)",
- CTSVC_DATA_NUMBER);
+ CONTACTS_DATA_TYPE_NUMBER);
bind_text = g_slist_append(bind_text, strdup(minmatch));
bind_text = g_slist_append(bind_text, strdup(normal_num));
}
ret = ctsvc_query_prepare(query, &stmt);
if (stmt == NULL) {
+ /* LCOV_EXCL_START */
ERR("ctsvc_query_prepare fail(%d)", ret);
if (bind_text) {
for (cursor = bind_text; cursor; cursor = cursor->next)
g_slist_free(bind_text);
}
return CONTACTS_ERROR_DB;
+ /* LCOV_EXCL_STOP */
}
if (bind_text) {
}
int ctsvc_db_phone_log_update_person_id(const char *number, int old_person_id,
- int candidate_person_id, bool person_link)
+ int candidate_person_id, bool person_link, int *found_person_id)
{
CTS_FN_CALL;
int ret;
ret = ctsvc_query_prepare(query, &get_log);
if (get_log == NULL) {
+ /* LCOV_EXCL_START */
ERR("ctsvc_query_prepare() Fail(%d)", ret);
if (bind_text) {
for (cursor = bind_text; cursor; cursor = cursor->next)
g_slist_free(bind_text);
}
return CONTACTS_ERROR_DB;
+ /* LCOV_EXCL_STOP */
}
if (bind_text) {
"UPDATE "CTS_TABLE_PHONELOGS" SET person_id=?, number_type = ? WHERE id = ?");
ret = ctsvc_query_prepare(query, &update_log);
if (update_log == NULL) {
+ /* LCOV_EXCL_START */
ERR("ctsvc_query_prepare() Fail(%d)", ret);
ctsvc_stmt_finalize(get_log);
g_slist_free(bind_text);
}
return CONTACTS_ERROR_DB;
+ /* LCOV_EXCL_STOP */
}
while ((ret = ctsvc_stmt_step(get_log))) {
minmatch_address, -1, &number_type);
if (new_person_id <= 0)
continue;
+
+ if (found_person_id)
+ *found_person_id = new_person_id;
} else if (number && 0 < old_person_id) {
/* CASE : number update/delete (contact update/delete) => find new_person_id by address */
/* CASE : phonelog insert with person_id */