#include "MsgGconfWrapper.h"
#include "MsgContact.h"
+#ifndef MSG_CONTACTS_SERVICE_NOT_SUPPORTED
extern "C"
{
#include <contacts.h>
}
+#endif /* MSG_CONTACTS_SERVICE_NOT_SUPPORTED */
/*==================================================================================================
VARIABLES
#define PHONENUMBER_MIN_MATCH_DIGIT VCONFKEY_CONTACTS_SVC_PHONENUMBER_MIN_MATCH_DIGIT
#define DEFAULT_MIN_MATCH_DIGIT 8
+#ifndef MSG_CONTACTS_SERVICE_NOT_SUPPORTED
static int phonenumberMinMatchDigit = -1;
+#endif
/*==================================================================================================
INTERNAL FUNCTION IMPLEMENTATION
==================================================================================================*/
+
int countryCodeLength(const char *src)
{
int ret = 0;
}
}
-
/*==================================================================================================
FUNCTION IMPLEMENTATION
==================================================================================================*/
msg_error_t MsgOpenContactSvc()
{
+#ifndef MSG_CONTACTS_SERVICE_NOT_SUPPORTED
int errCode = CONTACTS_ERROR_NONE;
if (!isContactSvcConnected) {
} else {
MSG_DEBUG("Already connected to Contact Service.");
}
-
+#endif /* MSG_CONTACTS_SERVICE_NOT_SUPPORTED */
return MSG_SUCCESS;
}
msg_error_t MsgCloseContactSvc()
{
+#ifndef MSG_CONTACTS_SERVICE_NOT_SUPPORTED
int errCode = CONTACTS_ERROR_NONE;
if (isContactSvcConnected) {
return MSG_ERR_DB_DISCONNECT;
}
}
-
+#endif /* MSG_CONTACTS_SERVICE_NOT_SUPPORTED */
return MSG_SUCCESS;
}
msg_error_t MsgInitContactSvc()
{
+#ifndef MSG_CONTACTS_SERVICE_NOT_SUPPORTED
phonenumberMinMatchDigit = MsgSettingGetInt(PHONENUMBER_MIN_MATCH_DIGIT);
MSG_DEBUG("phonenumberMinMatchDigit [%d]", phonenumberMinMatchDigit);
if (phonenumberMinMatchDigit < 1) {
phonenumberMinMatchDigit = DEFAULT_MIN_MATCH_DIGIT;
}
-
+#endif /* MSG_CONTACTS_SERVICE_NOT_SUPPORTED */
return MSG_SUCCESS;
}
msg_error_t MsgGetContactInfo(const MSG_ADDRESS_INFO_S *pAddrInfo, MSG_CONTACT_INFO_S *pContactInfo)
{
MSG_BEGIN();
-
+#ifndef MSG_CONTACTS_SERVICE_NOT_SUPPORTED
msg_error_t err = MSG_SUCCESS;
if ((err = MsgOpenContactSvc()) != MSG_SUCCESS) {
contacts_record_destroy(contact, true);
+#endif /* MSG_CONTACTS_SERVICE_NOT_SUPPORTED */
MSG_END();
return MSG_SUCCESS;
msg_error_t MsgGetContactSearchList(const char *pSearchVal, MSG_ADDRESS_INFO_S **pAddrInfo, int *count)
{
MSG_BEGIN();
+#ifndef MSG_CONTACTS_SERVICE_NOT_SUPPORTED
msg_error_t err = MSG_SUCCESS;
contacts_list_destroy(personNumbers, true);
+#endif /* MSG_CONTACTS_SERVICE_NOT_SUPPORTED */
MSG_END();
return MSG_SUCCESS;
int MsgGetContactNameOrder()
{
+#ifndef MSG_CONTACTS_SERVICE_NOT_SUPPORTED
contacts_name_display_order_e order = CONTACTS_NAME_DISPLAY_ORDER_FIRSTLAST;
return (int)order;
+#else
+ return 0;
+#endif /* MSG_CONTACTS_SERVICE_NOT_SUPPORTED */
}
msg_error_t MsgGetContactStyleDisplayName(const char *first, const char *last, const char *middle, const char *prefix, const char *suffix, int contactNameOrder, char *displayName, unsigned int size)
{
+#ifndef MSG_CONTACTS_SERVICE_NOT_SUPPORTED
+
if (first == NULL || last == NULL || middle == NULL || prefix == NULL || suffix == NULL || displayName == NULL || size ==0) {
MSG_DEBUG("Invalid parameter.");
return MSG_ERR_INVALID_PARAMETER;
MSG_SEC_DEBUG("displayName [%s]", displayName);
+#endif /* MSG_CONTACTS_SERVICE_NOT_SUPPORTED */
return MSG_SUCCESS;
}
void MsgAddPhoneLog(const MSG_MESSAGE_INFO_S *pMsgInfo)
{
+#ifndef MSG_CONTACTS_SERVICE_NOT_SUPPORTED
+
msg_error_t err = MSG_SUCCESS;
if ((err = MsgOpenContactSvc()) != MSG_SUCCESS) {
contacts_record_destroy(plog, true);
}
+#endif /* MSG_CONTACTS_SERVICE_NOT_SUPPORTED */
}
void MsgDeletePhoneLog(msg_message_id_t msgId)
{
+#ifndef MSG_CONTACTS_SERVICE_NOT_SUPPORTED
msg_error_t err = MSG_SUCCESS;
if ((err = MsgOpenContactSvc()) != MSG_SUCCESS) {
contacts_query_destroy(query);
contacts_filter_destroy(filter);
contacts_list_destroy(plogs, true);
+#endif /* MSG_CONTACTS_SERVICE_NOT_SUPPORTED */
}
int MsgContactGetMinMatchDigit()
{
+#ifndef MSG_CONTACTS_SERVICE_NOT_SUPPORTED
return phonenumberMinMatchDigit;
+#else
+ return DEFAULT_MIN_MATCH_DIGIT;
+#endif
}