int type = 0;
int oriType = 0;
PhoneNumberType phoneNumberType = PHONENUMBER_TYPE_HOME;
+ bool isChanged = false;
contacts_record_get_child_record_count(__contactHandle, _contacts_contact.number, &count);
SysTryReturn(NID_SCL, count > (unsigned int) index, E_OUT_OF_RANGE, E_OUT_OF_RANGE, "[%s] index=%d must be less than the current count(%d) of phone numbers.", GetErrorMessage(E_OUT_OF_RANGE), index, count);
type = CONTACTS_NUMBER_TYPE_ASSISTANT;
break;
case PHONENUMBER_TYPE_OTHER:
- contacts_record_get_int(recordHandle, _contacts_number.type, &oriType);
+ isChanged = _PhoneNumberImpl::GetInstance(phoneNumber)->IsPhoneNumberTypeChanged();
+ if (isChanged)
+ {
+ type = CONTACTS_NUMBER_TYPE_OTHER;
+ break;
+ }
+ contacts_record_get_int(recordHandle, _contacts_number.type, &oriType);
phoneNumberType = GetNativePhoneNumberType(oriType);
if (phoneNumberType == PHONENUMBER_TYPE_OTHER)
{
_PhoneNumberImpl::_PhoneNumberImpl(void)
: __recordId(-1)
, __type(PHONENUMBER_TYPE_HOME)
+, __isPhoneTypeChanged(false)
{
}
: __recordId(-1)
, __type(type)
, __number(number)
+, __isPhoneTypeChanged(false)
{
}
__type = rhs.__type;
__label = rhs.__label;
__number = rhs.__number;
+ __isPhoneTypeChanged = rhs.__isPhoneTypeChanged;
}
_PhoneNumberImpl::~_PhoneNumberImpl(void)
{
-
}
_PhoneNumberImpl&
__type = rhs.__type;
__label = rhs.__label;
__number = rhs.__number;
+ __isPhoneTypeChanged = rhs.__isPhoneTypeChanged;
return *this;
}
_PhoneNumberImpl::SetType(PhoneNumberType type)
{
__type = type;
+ __isPhoneTypeChanged = true;
}
result
return __number.IsEmpty();
}
+bool
+_PhoneNumberImpl::IsPhoneNumberTypeChanged(void) const
+{
+ return __isPhoneTypeChanged;
+}
+
_PhoneNumberImpl*
_PhoneNumberImpl::GetInstance(PhoneNumber& phoneNumber)
{
result SetPhoneNumber(const Tizen::Base::String& number);
-
// getter
int GetRecordId(void) const;
bool IsEmpty(void) const;
+ bool IsPhoneNumberTypeChanged(void) const;
+
static _PhoneNumberImpl* GetInstance(PhoneNumber& phoneNUmber);
static const _PhoneNumberImpl* GetInstance(const PhoneNumber& phoneNUmber);
PhoneNumberType __type;
Tizen::Base::String __label;
Tizen::Base::String __number;
+ bool __isPhoneTypeChanged;
}; // _PhoneNumberImpl
}} // Tizen::Social