From 9a60cf5c4a1d26a6e970742a2637cb498b692240 Mon Sep 17 00:00:00 2001 From: Jongkyu Koo Date: Thu, 24 Dec 2015 14:49:10 +0900 Subject: [PATCH] Add data usage type for rejected,blocked call and fix spelling error Change-Id: I4266ab2a065b9f9abf176227cfdcfa19d2d443a0 Signed-off-by: Jongkyu Koo --- common/ctsvc_record_phonelog.c | 2 +- include/contacts_types.h | 26 ++++++++++++++------------ server/ctsvc_server_phonelog.c | 2 +- server/db/ctsvc_db_plugin_phonelog.c | 34 +++++++++++++++++++++------------- 4 files changed, 37 insertions(+), 27 deletions(-) diff --git a/common/ctsvc_record_phonelog.c b/common/ctsvc_record_phonelog.c index e79abb5..69d45da 100644 --- a/common/ctsvc_record_phonelog.c +++ b/common/ctsvc_record_phonelog.c @@ -191,7 +191,7 @@ static int __ctsvc_phonelog_set_int(contacts_record_h record, unsigned int prope case CTSVC_PROPERTY_PHONELOG_LOG_TYPE: if ((CONTACTS_PLOG_TYPE_NONE <= value && value <= CONTACTS_PLOG_TYPE_VIDEO_BLOCKED) - || (CONTACTS_PLOG_TYPE_MMS_INCOMMING <= value + || (CONTACTS_PLOG_TYPE_MMS_INCOMING <= value && value <= CONTACTS_PLOG_TYPE_MMS_BLOCKED) || (CONTACTS_PLOG_TYPE_EMAIL_RECEIVED <= value && value <= CONTACTS_PLOG_TYPE_EMAIL_SENT) diff --git a/include/contacts_types.h b/include/contacts_types.h index eafe975..48caf5e 100644 --- a/include/contacts_types.h +++ b/include/contacts_types.h @@ -188,22 +188,22 @@ typedef enum { */ typedef enum { CONTACTS_PLOG_TYPE_NONE, /**< None */ - CONTACTS_PLOG_TYPE_VOICE_INCOMMING = 1, /**< Incoming call */ + CONTACTS_PLOG_TYPE_VOICE_INCOMING = 1, /**< Incoming call */ CONTACTS_PLOG_TYPE_VOICE_OUTGOING = 2, /**< Outgoing call */ - CONTACTS_PLOG_TYPE_VIDEO_INCOMMING = 3, /**< Incoming video call */ + CONTACTS_PLOG_TYPE_VIDEO_INCOMING = 3, /**< Incoming video call */ CONTACTS_PLOG_TYPE_VIDEO_OUTGOING = 4, /**< Outgoing video call */ - CONTACTS_PLOG_TYPE_VOICE_INCOMMING_UNSEEN = 5, /**< Not confirmed missed call */ - CONTACTS_PLOG_TYPE_VOICE_INCOMMING_SEEN = 6, /**< Confirmed missed call */ - CONTACTS_PLOG_TYPE_VIDEO_INCOMMING_UNSEEN = 7, /**< Not confirmed missed video call */ - CONTACTS_PLOG_TYPE_VIDEO_INCOMMING_SEEN = 8, /**< Confirmed missed video call */ + CONTACTS_PLOG_TYPE_VOICE_INCOMING_UNSEEN = 5, /**< Not confirmed missed call */ + CONTACTS_PLOG_TYPE_VOICE_INCOMING_SEEN = 6, /**< Confirmed missed call */ + CONTACTS_PLOG_TYPE_VIDEO_INCOMING_UNSEEN = 7, /**< Not confirmed missed video call */ + CONTACTS_PLOG_TYPE_VIDEO_INCOMING_SEEN = 8, /**< Confirmed missed video call */ CONTACTS_PLOG_TYPE_VOICE_REJECT = 9, /**< Rejected call */ CONTACTS_PLOG_TYPE_VIDEO_REJECT = 10, /**< Rejected video call */ CONTACTS_PLOG_TYPE_VOICE_BLOCKED = 11, /**< Blocked call */ CONTACTS_PLOG_TYPE_VIDEO_BLOCKED = 12, /**< Blocked video call */ - CONTACTS_PLOG_TYPE_MMS_INCOMMING = 101, /**< Incoming MMS */ + CONTACTS_PLOG_TYPE_MMS_INCOMING = 101, /**< Incoming MMS */ CONTACTS_PLOG_TYPE_MMS_OUTGOING = 102, /**< Outgoing MMS */ - CONTACTS_PLOG_TYPE_SMS_INCOMMING = 103, /**< Incoming SMS */ + CONTACTS_PLOG_TYPE_SMS_INCOMING = 103, /**< Incoming SMS */ CONTACTS_PLOG_TYPE_SMS_OUTGOING = 104, /**< Outgoing SMS */ CONTACTS_PLOG_TYPE_SMS_BLOCKED = 105, /**< Blocked SMS */ CONTACTS_PLOG_TYPE_MMS_BLOCKED = 106, /**< Blocked MMS */ @@ -259,10 +259,12 @@ typedef enum { CONTACTS_USAGE_STAT_TYPE_OUTGOING_CALL, /**< Outgoing call */ CONTACTS_USAGE_STAT_TYPE_OUTGOING_MSG, /**< Outgoing message */ CONTACTS_USAGE_STAT_TYPE_OUTGOING_EMAIL, /**< Outgoing email (Since 3.0) */ - CONTACTS_USAGE_STAT_TYPE_INCOMMING_CALL, /**< Incomming call (Since 3.0) */ - CONTACTS_USAGE_STAT_TYPE_INCOMMING_MSG, /**< Incomming message (Since 3.0) */ - CONTACTS_USAGE_STAT_TYPE_INCOMMING_EMAIL,/**< Incomming email (Since 3.0) */ - CONTACTS_USAGE_STAT_TYPE_MISSED_CALL /**< Missed call (Since 3.0) */ + CONTACTS_USAGE_STAT_TYPE_INCOMING_CALL, /**< Incoming call (Since 3.0) */ + CONTACTS_USAGE_STAT_TYPE_INCOMING_MSG, /**< Incoming message (Since 3.0) */ + CONTACTS_USAGE_STAT_TYPE_INCOMING_EMAIL,/**< Incoming email (Since 3.0) */ + CONTACTS_USAGE_STAT_TYPE_MISSED_CALL, /**< Missed call (Since 3.0) */ + CONTACTS_USAGE_STAT_TYPE_REJECTED_CALL, /**< Rejected call (Since 3.0) */ + CONTACTS_USAGE_STAT_TYPE_BLOCKED_CALL /**< Blocked call (Since 3.0) */ }contacts_usage_type_e; /** diff --git a/server/ctsvc_server_phonelog.c b/server/ctsvc_server_phonelog.c index c4d4ac2..51c9b78 100644 --- a/server/ctsvc_server_phonelog.c +++ b/server/ctsvc_server_phonelog.c @@ -65,7 +65,7 @@ int ctsvc_phone_log_delete(contacts_phone_log_delete_e op, ...) snprintf(query, sizeof(query), "DELETE FROM "CTS_TABLE_PHONELOGS" " "WHERE data1 = %d AND %d <= log_type AND log_type <= %d", - extra_data1, CONTACTS_PLOG_TYPE_MMS_INCOMMING, CONTACTS_PLOG_TYPE_MMS_BLOCKED); + extra_data1, CONTACTS_PLOG_TYPE_MMS_INCOMING, CONTACTS_PLOG_TYPE_MMS_BLOCKED); break; case CONTACTS_PHONE_LOG_DELETE_BY_EMAIL_EXTRA_DATA1: va_start(args, op); diff --git a/server/db/ctsvc_db_plugin_phonelog.c b/server/db/ctsvc_db_plugin_phonelog.c index 3b42c24..f199eb2 100644 --- a/server/db/ctsvc_db_plugin_phonelog.c +++ b/server/db/ctsvc_db_plugin_phonelog.c @@ -121,8 +121,8 @@ static int __ctsvc_db_phonelog_update_record(contacts_record_h record) RETV_IF(NULL == record, CONTACTS_ERROR_INVALID_PARAMETER); RETVM_IF(phonelog->id <= 0, CONTACTS_ERROR_INVALID_PARAMETER, "The phone_log has ID(%d)", phonelog->id); - RETVM_IF(phonelog->log_type != CONTACTS_PLOG_TYPE_VOICE_INCOMMING_SEEN && - phonelog->log_type != CONTACTS_PLOG_TYPE_VIDEO_INCOMMING_SEEN, CONTACTS_ERROR_INVALID_PARAMETER, + RETVM_IF(phonelog->log_type != CONTACTS_PLOG_TYPE_VOICE_INCOMING_SEEN && + phonelog->log_type != CONTACTS_PLOG_TYPE_VIDEO_INCOMING_SEEN, CONTACTS_ERROR_INVALID_PARAMETER, "the type is can not updated(%d)", phonelog->log_type); RETVM_IF(CTSVC_PROPERTY_FLAG_DIRTY != (phonelog->base.property_flag & CTSVC_PROPERTY_FLAG_DIRTY), CONTACTS_ERROR_NONE, "No update"); @@ -360,23 +360,31 @@ static int __ctsvc_db_phonelog_increase_used_count(ctsvc_phonelog_s *phonelog) case CONTACTS_PLOG_TYPE_EMAIL_SENT: type = CONTACTS_USAGE_STAT_TYPE_OUTGOING_EMAIL; break; - case CONTACTS_PLOG_TYPE_VOICE_INCOMMING: - case CONTACTS_PLOG_TYPE_VIDEO_INCOMMING: - type = CONTACTS_USAGE_STAT_TYPE_INCOMMING_CALL; + case CONTACTS_PLOG_TYPE_VOICE_INCOMING: + case CONTACTS_PLOG_TYPE_VIDEO_INCOMING: + type = CONTACTS_USAGE_STAT_TYPE_INCOMING_CALL; break; - case CONTACTS_PLOG_TYPE_MMS_INCOMMING: - case CONTACTS_PLOG_TYPE_SMS_INCOMMING: - type = CONTACTS_USAGE_STAT_TYPE_INCOMMING_MSG; + case CONTACTS_PLOG_TYPE_MMS_INCOMING: + case CONTACTS_PLOG_TYPE_SMS_INCOMING: + type = CONTACTS_USAGE_STAT_TYPE_INCOMING_MSG; break; case CONTACTS_PLOG_TYPE_EMAIL_RECEIVED: - type = CONTACTS_USAGE_STAT_TYPE_INCOMMING_EMAIL; + type = CONTACTS_USAGE_STAT_TYPE_INCOMING_EMAIL; break; - case CONTACTS_PLOG_TYPE_VOICE_INCOMMING_UNSEEN: - case CONTACTS_PLOG_TYPE_VOICE_INCOMMING_SEEN: - case CONTACTS_PLOG_TYPE_VIDEO_INCOMMING_UNSEEN: - case CONTACTS_PLOG_TYPE_VIDEO_INCOMMING_SEEN: + case CONTACTS_PLOG_TYPE_VOICE_INCOMING_UNSEEN: + case CONTACTS_PLOG_TYPE_VOICE_INCOMING_SEEN: + case CONTACTS_PLOG_TYPE_VIDEO_INCOMING_UNSEEN: + case CONTACTS_PLOG_TYPE_VIDEO_INCOMING_SEEN: type = CONTACTS_USAGE_STAT_TYPE_MISSED_CALL; break; + case CONTACTS_PLOG_TYPE_VOICE_REJECT: + case CONTACTS_PLOG_TYPE_VIDEO_REJECT: + type = CONTACTS_USAGE_STAT_TYPE_REJECTED_CALL; + break; + case CONTACTS_PLOG_TYPE_VOICE_BLOCKED: + case CONTACTS_PLOG_TYPE_VIDEO_BLOCKED: + type = CONTACTS_USAGE_STAT_TYPE_BLOCKED_CALL; + break; default: return CONTACTS_ERROR_NONE; } -- 2.7.4