#define _PHN_CALL_LOG_MANAGER_H_
#include "contacts.h"
#include <FBase.h>
+#include <FSocial.h>
#include "CallInfo.h"
#include "CallTypes.h"
#include "CallICalllogChangeListener.h"
+using namespace Tizen::Social;
class CallLogDetails;
/**
static void CreateInstance(void);
static void DestroyInstance(void);
unsigned long GetDuration(long long start_time);
+ int GetPersonId(Tizen::Base::String& personId);
public:
result AddCallogInfoToDatabase(CallInfo* calllogInfo);
private:
static CallLogManager* __pCallogManager;
+ Addressbook* pAddressBook;
};
%post
/sbin/ldconfig
-PKG_ID=zktdpemtmw
+PKG_ID=nI2PLNdTwi
echo "/usr/etc/package-manager/backend/tpk -i /usr/apps/"${PKG_ID}
/usr/etc/package-manager/backend/tpk -i /usr/apps/${PKG_ID}
cp -f /usr/lib/osp/osp-ui-app-loader /usr/apps/${PKG_ID}/bin/Call
%postun
/sbin/ldconfig
-PKG_ID=zktdpemtmw
+PKG_ID=nI2PLNdTwi
echo "/usr/etc/package-manager/backend/tpk -u "${PKG_ID}
/usr/etc/package-manager/backend/tpk -u ${PKG_ID}
CallLogManager::CallLogManager(void)
{
+ pAddressBook = AddressbookManager::GetInstance()->GetAddressbookN();
}
CallLogManager::~CallLogManager(void)
}
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;
+}