break;
default:
match = CONTACTS_MATCH_NONE;
+ break;
};
return match;
break;
default:
match = CONTACTS_MATCH_EXISTS;
+ break;
};
return match;
contacts_filter_add_operator(__filterHandle, filterOperator);
}
- int ret = contacts_filter_add_str(__filterHandle, viewPropertyId, match, pCharArray.get());
- SysTryReturn(NID_SCL, ret == CONTACTS_ERROR_NONE, E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[%s] Memory allocation failed.", GetErrorMessage(E_OUT_OF_MEMORY));
+ int ret = CONTACTS_ERROR_NONE;
+
+ if (filterProperty == PHONE_CONTACT_FI_PR_PHONE)
+ {
+ contacts_filter_h numberHandle = null;
+ ret = contacts_filter_create(_contacts_contact_number._uri, &numberHandle);
+ SysTryReturn(NID_SCL, ret == CONTACTS_ERROR_NONE, E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[%s ] Memory allocation failed.", GetErrorMessage(GetLastResult()));
+ contacts_filter_add_str(numberHandle, viewPropertyId, match, pCharArray.get());
+ contacts_filter_add_operator(numberHandle, CONTACTS_FILTER_OPERATOR_OR);
+ contacts_filter_add_str(numberHandle, _contacts_contact_number.number, match, pCharArray.get());
+
+ ret = contacts_filter_add_filter(__filterHandle, numberHandle);
+ contacts_filter_destroy(numberHandle);
+ SysTryReturn(NID_SCL, ret == CONTACTS_ERROR_NONE, E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[%s] Memory allocation failed.", GetErrorMessage(E_OUT_OF_MEMORY));
+ }
+ else
+ {
+ ret = contacts_filter_add_str(__filterHandle, viewPropertyId, match, pCharArray.get());
+ SysTryReturn(NID_SCL, ret == CONTACTS_ERROR_NONE, E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[%s] Memory allocation failed.", GetErrorMessage(E_OUT_OF_MEMORY));
+ }
__isEmpty = false;
filter.AddInt(_contacts_contact_number.address_book_id, CONTACTS_MATCH_EQUAL, __addressbookId);
filter.AddOperator(CONTACTS_FILTER_OPERATOR_AND);
filter.AddString(_contacts_contact_number.normalized_number, CONTACTS_MATCH_CONTAINS, pCharArray.get());
+ filter.AddOperator(CONTACTS_FILTER_OPERATOR_OR);
+ filter.AddString(_contacts_contact_number.number, CONTACTS_MATCH_CONTAINS, pCharArray.get());
unsigned int projectionIds[1];
projectionIds[0] = _contacts_contact_number.contact_id;
__Filter<__ContactsContactNumber> numberFilter;
numberFilter.Construct();
numberFilter.AddString(_contacts_contact_number.normalized_number, CONTACTS_MATCH_CONTAINS, pCharArray.get());
+ numberFilter.AddOperator(CONTACTS_FILTER_OPERATOR_OR);
+ numberFilter.AddString(_contacts_contact_number.number, CONTACTS_MATCH_CONTAINS, pCharArray.get());
if (pRwAbFilter->Get() != null)
{
default:
SysLogException(NID_SCL, E_INVALID_ARG, "[%s] Invalid argument is used. The filter type is invalid", GetErrorMessage(E_INVALID_ARG));
pList = null;
+ break;
};
return pList;
default:
SysLogException(NID_SCL, E_INVALID_ARG, "[%s] Invalid argument is used. The type of the filter is invalid", GetErrorMessage(GetLastResult()));
count = 0;
+ break;
};
return count;