CallLogManager::CallLogManager(void)
{
+ pAddressBook = AddressbookManager::GetInstance()->GetAddressbookN();
}
CallLogManager::~CallLogManager(void)
}
result
-CallLogManager::AddCallogInfoToDatabase(CallInfo* calllogInfo)
+CallLogManager::AddCallogInfoToDatabase(AppCallInfo* calllogInfo)
{
AppLog(" AddVoiceCallInfo Entry");
int duration = 0;
case CALL_LOG_TYPE_VOICE_OUTGOING:
logType = CONTACTS_PLOG_TYPE_VOICE_OUTGOING;
break;
- case CALL_LOG_TYPE_VOICE_MISSED:
+ case CALL_LOG_TYPE_VOICE_MISSED_UNSEEN:
logType = CONTACTS_PLOG_TYPE_VOICE_INCOMMING_UNSEEN;
break;
case CALL_LOG_TYPE_VOICE_REJECTED:
}
int id;
+ int personid = GetPersonId(PhNumber);
+ if (personid != -1)
+ {
+ if(contacts_record_set_int(hContactLog,_contacts_phone_log.person_id,personid) != CONTACTS_ERROR_NONE)
+ {
+ AppLog(" calllog_set_type personid failed");
+ }
+ }
if (contacts_record_set_int(hContactLog,_contacts_phone_log.log_type,logType) != CONTACTS_ERROR_NONE)
{
call_duration_in_sec = curr_time - start_time;
return call_duration_in_sec;
}
+int
+CallLogManager::GetPersonId(Tizen::Base::String& phoneNumber)
+{
+ int personId = -1;
+ if (pAddressBook != null)
+ {
+ IList* pNumberContactsList = pAddressBook->SearchContactsByPhoneNumberN(phoneNumber);
+ if(pNumberContactsList != null)
+ {
+ Contact* pContact = static_cast<Contact*>(pNumberContactsList->GetAt(0));
+ if(pContact != null)
+ {
+ personId = pContact->GetPersonId();
+ }
+ }
+ }
+ return personId;
+}