Search in sources :

Example 1 with VCardHelper

use of com.vodafone360.people.datatypes.VCardHelper in project 360-Engine-for-Android by 360.

the class NativeContactsApi1 method putContactMethodValues.

/**
     * Put Contact Methods detail into the values
     * 
     * @param cc {@link ContactChange} to read values from
     * @param kind The kind of contact method (email or address)
     * @param nabContactId ID of the NAB Contact
     */
private void putContactMethodValues(ContactChange cc, int kind, long nabContactId) {
    mValues.put(ContactMethods.PERSON_ID, nabContactId);
    if (kind == CONTACT_METHODS_KIND_EMAIL) {
        mValues.put(ContactMethods.DATA, cc.getValue());
    } else {
        // Must be Address, once again need to use VCardHelper to extract
        // address
        PostalAddress address = VCardHelper.getPostalAddress(cc.getValue());
        mValues.put(ContactMethods.DATA, address.toString());
    }
    mValues.put(ContactMethods.KIND, kind);
    int flags = cc.getFlags();
    mValues.put(ContactMethods.TYPE, mapToNabContactMethodType(flags));
    mValues.put(ContactMethods.ISPRIMARY, flags & ContactChange.FLAG_PREFERRED);
}
Also used : PostalAddress(com.vodafone360.people.datatypes.VCardHelper.PostalAddress)

Aggregations

PostalAddress (com.vodafone360.people.datatypes.VCardHelper.PostalAddress)1