summaryrefslogtreecommitdiff
path: root/src/calllog.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/calllog.c')
-rwxr-xr-xsrc/calllog.c21
1 files changed, 20 insertions, 1 deletions
diff --git a/src/calllog.c b/src/calllog.c
index 7ca5855..943c1f1 100755
--- a/src/calllog.c
+++ b/src/calllog.c
@@ -191,7 +191,7 @@ int calllog_update_missed_unchecked_to_checked_to_db(int calllog_db_id)
int calllog_get_time(calllog_h log, time_t* log_time)
{
- if(log == NULL || time == NULL) {
+ if(log == NULL || log_time == NULL) {
LOGE("[%s] CALLLOG_ERROR_INVALID_PARAMETER(0x%08x)", __FUNCTION__, CALLLOG_ERROR_INVALID_PARAMETER);
return CALLLOG_ERROR_INVALID_PARAMETER;
}
@@ -384,11 +384,30 @@ int calllog_query_calllog_by_number(calllog_foreach_cb cb, const char* number_to
_calllog_safe_free(query_data.contact_image_path);
_calllog_safe_free(query_data.phone_number);
_calllog_safe_free(query_data.short_message);
+ if (!func_ret) {
+ break;
+ }
}
contacts_svc_iter_remove(iter);
return CALLLOG_ERROR_NONE;
}
+int calllog_add_calllog_db_changed_cb(calllog_db_changed_cb callback, void *user_data)
+{
+ if(contacts_svc_subscribe_change(CTS_SUBSCRIBE_PLOG_CHANGE, callback, user_data) == CTS_SUCCESS)
+ return CALLLOG_ERROR_NONE;
+
+ LOGE("[%s] CALLLOG_ERROR_INVALID_PARAMETER(0x%08x)", __FUNCTION__, CALLLOG_ERROR_INVALID_PARAMETER);
+ return CALLLOG_ERROR_INVALID_PARAMETER;
+}
+int calllog_remove_calllog_db_changed_cb(calllog_db_changed_cb callback)
+{
+ if(contacts_svc_unsubscribe_change(CTS_SUBSCRIBE_PLOG_CHANGE, callback) == CTS_SUCCESS)
+ return CALLLOG_ERROR_NONE;
+
+ LOGE("[%s] CONTACTS_ERROR_INVALID_PARAMETER(0x%08x)", __FUNCTION__, CALLLOG_ERROR_INVALID_PARAMETER);
+ return CALLLOG_ERROR_INVALID_PARAMETER;
+}