com.vodafone360.people.engine.contactsync
Class NativeContactsApi2

java.lang.Object
  extended by com.vodafone360.people.engine.contactsync.NativeContactsApi
      extended by com.vodafone360.people.engine.contactsync.NativeContactsApi2

public class NativeContactsApi2
extends NativeContactsApi

The implementation of the NativeContactsApi for the Android 2.X platform.


Nested Class Summary
private  class NativeContactsApi2.BatchOperation
          Inner class for applying batches.
private  class NativeContactsApi2.NativeContentObserver
          This class holds a native content observer that will be notified in case of changes on the registered URI.
private static interface NativeContactsApi2.PeopleProfileColumns
          Convenience interface to map the generic DATA column names to the People profile detail column names.
 
Nested classes/interfaces inherited from class com.vodafone360.people.engine.contactsync.NativeContactsApi
NativeContactsApi.Account, NativeContactsApi.ContactsObserver
 
Field Summary
private static java.lang.String[] CONTACTID_PROJECTION
          Convenience Projection to fetch only a Raw Contact's ID and Native Account Type
private static int CONTACTID_PROJECTION_ACCOUNT_TYPE
          Account Type Column for the CONTACTID_PROJECTION Projection
private static int CONTACTID_PROJECTION_RAW_ID
          Raw ID Column for the CONTACTID_PROJECTION Projection
private static java.lang.String[] GROUPID_PROJECTION
          Group ID Projection
private  NativeContactsApi.ContactsObserver mAbstractedObserver
          The observer registered by the upper layer.
private  NativeContactsApi2.BatchOperation mBatch
          Batch used for Contact Writing operations.
private  ContentObserver[] mContentObservers
          The content observers that listens for native contacts changes.
private  long mExistingOrganizationId
          Arguably another example where Organization and Title force us into extra effort.
private  boolean mHaveReadBirthday
          Flag to check if we have already read a Birthday detail
private  long[] mMyContactsGroupRowIds
          Array of row ID in the groups table to the "My Contacts" System Group.
private  ContentValues mValues
          Content values used for writing to NAB.
private static java.lang.String MY_CONTACTS_GROUP_WHERE_CLAUSE
          'My Contacts' System group where clause
private static java.lang.String MY_CONTACTS_MULTI_GROUP_MEMBERSHIP
          'My Contacts' System Group Membership where in clause (Multiple 'My Contacts' IDs)
private  boolean mYield
          Yield value for our ContentProviderOperations.
private static java.lang.String NULL_ACCOUNT_WHERE_CLAUSE
          Selection where clause for a NULL Account
private static java.lang.String ORGANIZATION_DETAIL_WHERE_CLAUSE
          Selection where clause for an Organization detail.
private static  sFromKeyToNabContentTypeArray
          Holds mapping from a VCard Key to a NAB type (MIME)
private static java.util.HashMap<java.lang.String,java.lang.Integer> sFromNabContentTypeToKeyMap
          Holds mapping from a NAB type (MIME) to a VCard Key
private static Uri[] sUri
          The list of Uri that need to be listened to for contacts changes on native side.
 
Fields inherited from class com.vodafone360.people.engine.contactsync.NativeContactsApi
mContext, mCr, mHaveReadOrganization, mMarkedOrganizationIndex, mMarkedTitleIndex, PEOPLE_ACCOUNT_TYPE
 
Constructor Summary
NativeContactsApi2()
           
 
Method Summary
private static Uri addCallerIsSyncAdapterParameter(Uri uri)
          Static utility method that adds the Sync Adapter flag to the provided URI
 ContactChange[] addContact(NativeContactsApi.Account account, ContactChange[] ccList)
          Adds a contact.
private  void addDeleteDetailToBatch(long nabDetailId)
          Adds a delete detail operation to the batch.
 boolean addPeopleAccount(java.lang.String username)
          Adds the currently logged in user account to the NAB accounts.
private  void addProfileAction(long internalContactId)
          Adds the profile action detail to a (assumed) pending new Contact Batch operation.
private  void addUpdateValuesToBatch(long nabDetailId)
          Adds current update values to the batch.
private  void addValuesToBatch(long nabContactId)
          Adds current values to the batch.
private  ContactChange[] executeNewContactBatch(ContactChange[] ccList)
          Executes a pending Batch Operation related to adding a new Contact.
private  ContactChange[] executeUpdateContactBatch(ContactChange[] ccList)
          Executes a pending Batch Operation related to updating a Contact.
private  void fetchMyContactsGroupRowIds()
          Fetches the IDs corresponding to the "My Contacts" System Group The reason why we return an array is because there may be multiple "My Contacts" groups.
 NativeContactsApi.Account[] getAccounts()
          Fetches all the existing Accounts on the device.
 NativeContactsApi.Account[] getAccountsByType(java.lang.String type)
          Fetches all the existing Accounts on the device corresponding to the provided Type Only supported on 2.X.
 ContactChange[] getContact(long nabContactId)
          Gets data for one Contact.
 long[] getContactIds(NativeContactsApi.Account account)
          Retrieves a list of contact IDs for a specific account.
private  long[] getContactIds(java.lang.String selection)
          Inner (private) method for getting contact ids.
protected  void initialize()
          Method meant to be called only just after createInstance() is invoked.
private  boolean isContactInMyContactsGroup(long nabContactId)
          Checks if a Contact is in the "My Contacts" System Group
 boolean isKeySupported(int key)
          Checks whether or not a ContactChange key is supported.
 boolean isPeopleAccountCreated()
          Checks if there is a People Account in the NAB Accounts.
private static int mapFromNabAddressType(int nabType)
          Maps a address type from the native value into the ContactChange flags
private static int mapFromNabEmailType(int nabType)
          Maps a email type from the native value into the ContactChange flags
private static int mapFromNabOrganizationType(int nabType)
          Maps a organization type from the native value into the ContactChange flags
private static int mapFromNabPhoneType(int nabType)
          Maps a phone type from the native value to the ContactChange flags.
private static int mapFromNabWebsiteType(int nabType)
          Maps a Website type from the native value into the ContactChange flags
private static int mapToNabAddressType(int flags)
          Maps ContactChange flags into the native address type.
private static int mapToNabEmailType(int flags)
          Maps ContactChange flags into the native email type.
private static int mapToNabOrganizationType(int flags)
          Maps ContactChange flags into the native organization type.
private static int mapToNabPhoneType(int flags)
          Maps ContactChange flags into the native phone type.
private static int mapToNabWebsiteType(int flags)
          Maps ContactChange flags into the native Website type.
private  void putAddress(ContactChange cc)
          Put Address detail into the values
private  void putBirthday(ContactChange cc)
          Put Birthday detail into the values
private  void putDetail(ContactChange cc)
          Put values for a detail from a ContactChange into pending values.
private  void putEmail(ContactChange cc)
          Put Email detail into the values
private  void putName(ContactChange cc)
          Put Name detail into the values
private  void putNickname(ContactChange cc)
          Put Nickname detail into the values
private  void putNote(ContactChange cc)
          Put Note detail into the values
private  void putOrganization(ContactChange[] ccList)
          Put Organization detail into the values
private  void putPhone(ContactChange cc)
          Put Phone detail into the values
private  void putWebsite(ContactChange cc)
          Put Website detail into the values
private  void readAddress(Cursor cursor, java.util.List<ContactChange> ccList, long nabContactId)
          Reads an address detail as a ContactChange from the provided cursor.
 void readBirthday(Cursor cursor, java.util.List<ContactChange> ccList, long nabContactId)
          Reads an Birthday detail as a ContactChange from the provided cursor.
private  void readDetail(Cursor cursor, java.util.List<ContactChange> ccList, long nabContactId)
          Reads a Contact Detail from a Cursor into the supplied Contact Change List.
private  void readEmail(Cursor cursor, java.util.List<ContactChange> ccList, long nabContactId)
          Reads an email detail as a ContactChange from the provided cursor.
private  void readName(Cursor cursor, java.util.List<ContactChange> ccList, long nabContactId)
          Reads an name detail as a ContactChange from the provided cursor.
private  void readNickname(Cursor cursor, java.util.List<ContactChange> ccList, long nabContactId)
          Reads an nickname detail as a ContactChange from the provided cursor.
private  void readOrganization(Cursor cursor, java.util.List<ContactChange> ccList, long nabContactId)
          Reads an organization detail as a ContactChange from the provided cursor.
private  void readPhone(Cursor cursor, java.util.List<ContactChange> ccList, long nabContactId)
          Reads an phone detail as a ContactChange from the provided cursor.
private  void readWebsite(Cursor cursor, java.util.List<ContactChange> ccList, long nabContactId)
          Reads an Website detail as a ContactChange from the provided cursor.
 void registerObserver(NativeContactsApi.ContactsObserver observer)
          Registers a content observer.
 void removeContact(long nabContactId)
          Removes a contact
 void removePeopleAccount()
          Removes the (first found) People Account from the NAB accounts.
 void unregisterObserver()
          Unregister the previously registered content observer.
 ContactChange[] updateContact(ContactChange[] ccList)
          Updates an existing contact.
private  void updateOrganization(ContactChange[] ccList, long nabContactId)
          Updates the Organization detail in the context of a Contact Update operation.
 
Methods inherited from class com.vodafone360.people.engine.contactsync.NativeContactsApi
createInstance, destroyInstance, getInstance
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CONTACTID_PROJECTION

private static final java.lang.String[] CONTACTID_PROJECTION
Convenience Projection to fetch only a Raw Contact's ID and Native Account Type


CONTACTID_PROJECTION_RAW_ID

private static final int CONTACTID_PROJECTION_RAW_ID
Raw ID Column for the CONTACTID_PROJECTION Projection

See Also:
Constant Field Values

CONTACTID_PROJECTION_ACCOUNT_TYPE

private static final int CONTACTID_PROJECTION_ACCOUNT_TYPE
Account Type Column for the CONTACTID_PROJECTION Projection

See Also:
Constant Field Values

GROUPID_PROJECTION

private static final java.lang.String[] GROUPID_PROJECTION
Group ID Projection


MY_CONTACTS_GROUP_WHERE_CLAUSE

private static final java.lang.String MY_CONTACTS_GROUP_WHERE_CLAUSE
'My Contacts' System group where clause


MY_CONTACTS_MULTI_GROUP_MEMBERSHIP

private static final java.lang.String MY_CONTACTS_MULTI_GROUP_MEMBERSHIP
'My Contacts' System Group Membership where in clause (Multiple 'My Contacts' IDs)


NULL_ACCOUNT_WHERE_CLAUSE

private static final java.lang.String NULL_ACCOUNT_WHERE_CLAUSE
Selection where clause for a NULL Account


ORGANIZATION_DETAIL_WHERE_CLAUSE

private static final java.lang.String ORGANIZATION_DETAIL_WHERE_CLAUSE
Selection where clause for an Organization detail.


sUri

private static final Uri[] sUri
The list of Uri that need to be listened to for contacts changes on native side.


sFromNabContentTypeToKeyMap

private static final java.util.HashMap<java.lang.String,java.lang.Integer> sFromNabContentTypeToKeyMap
Holds mapping from a NAB type (MIME) to a VCard Key


sFromKeyToNabContentTypeArray

private static final  sFromKeyToNabContentTypeArray
Holds mapping from a VCard Key to a NAB type (MIME)


mAbstractedObserver

private NativeContactsApi.ContactsObserver mAbstractedObserver
The observer registered by the upper layer.


mValues

private final ContentValues mValues
Content values used for writing to NAB.


mContentObservers

private final ContentObserver[] mContentObservers
The content observers that listens for native contacts changes.


mMyContactsGroupRowIds

private long[] mMyContactsGroupRowIds
Array of row ID in the groups table to the "My Contacts" System Group. The reason for this being an array is because there may be multiple "My Contacts" groups (Platform Bug!?).


mExistingOrganizationId

private long mExistingOrganizationId
Arguably another example where Organization and Title force us into extra effort. We use this value to pass the correct detail ID when an 'add detail' is done for one the two although the other is already present. Make sure to reset this value for every UpdateContact operation


mHaveReadBirthday

private boolean mHaveReadBirthday
Flag to check if we have already read a Birthday detail


mYield

private boolean mYield
Yield value for our ContentProviderOperations.


mBatch

private NativeContactsApi2.BatchOperation mBatch
Batch used for Contact Writing operations.

Constructor Detail

NativeContactsApi2

public NativeContactsApi2()
Method Detail

registerObserver

public void registerObserver(NativeContactsApi.ContactsObserver observer)
Description copied from class: NativeContactsApi
Registers a content observer. Note: the method only supports one observer at a time.

Specified by:
registerObserver in class NativeContactsApi
Parameters:
observer - ContactsObserver currently observing native address book changes
See Also:
NativeContactsApi.registerObserver(ContactsObserver)

unregisterObserver

public void unregisterObserver()
Description copied from class: NativeContactsApi
Unregister the previously registered content observer.

Specified by:
unregisterObserver in class NativeContactsApi
See Also:
NativeContactsApi#unregisterObserver(ContactsObserver)

initialize

protected void initialize()
Description copied from class: NativeContactsApi
Method meant to be called only just after createInstance() is invoked. This method effectively acts as a replacement for the constructor because of the use of reflection.

Specified by:
initialize in class NativeContactsApi
See Also:
NativeContactsApi.initialize()

getAccounts

public NativeContactsApi.Account[] getAccounts()
Description copied from class: NativeContactsApi
Fetches all the existing Accounts on the device. Only supported on 2.X. The 1.X implementation always returns null.

Specified by:
getAccounts in class NativeContactsApi
Returns:
An array containing all the Accounts on the device, or null if none exist
See Also:
NativeContactsApi.getAccounts()

getAccountsByType

public NativeContactsApi.Account[] getAccountsByType(java.lang.String type)
Description copied from class: NativeContactsApi
Fetches all the existing Accounts on the device corresponding to the provided Type Only supported on 2.X. The 1.X implementation always returns null.

Specified by:
getAccountsByType in class NativeContactsApi
Parameters:
type - The Type of Account to fetch
Returns:
An array containing all the Accounts of the provided Type, or null if none exist
See Also:
getAccountsByType(String)

addPeopleAccount

public boolean addPeopleAccount(java.lang.String username)
Description copied from class: NativeContactsApi
Adds the currently logged in user account to the NAB accounts. Only supported on 2.X. The 1.X implementation does nothing.

Specified by:
addPeopleAccount in class NativeContactsApi
Returns:
true if successful, false if not
See Also:
NativeContactsApi.addPeopleAccount(String)

isPeopleAccountCreated

public boolean isPeopleAccountCreated()
Description copied from class: NativeContactsApi
Checks if there is a People Account in the NAB Accounts. Only supported on 2.X The 1.X implementation does nothing.

Specified by:
isPeopleAccountCreated in class NativeContactsApi
Returns:
true if an account exists, false if not.
See Also:
NativeContactsApi.isPeopleAccountCreated()

removePeopleAccount

public void removePeopleAccount()
Description copied from class: NativeContactsApi
Removes the (first found) People Account from the NAB accounts. Only supported on 2.X. The 1.X implementation does nothing.

Specified by:
removePeopleAccount in class NativeContactsApi
See Also:
NativeContactsApi.removePeopleAccount()

getContactIds

public long[] getContactIds(NativeContactsApi.Account account)
Description copied from class: NativeContactsApi
Retrieves a list of contact IDs for a specific account. In 1.X devices only the null account is supported, i.e., a non null account always uses null as a return value.

Specified by:
getContactIds in class NativeContactsApi
Parameters:
account - The account to get contact IDs from (may be null)
Returns:
List of contact IDs from the native address book
See Also:
NativeContactsApi.getContactIds(Account)

getContact

public ContactChange[] getContact(long nabContactId)
Description copied from class: NativeContactsApi
Gets data for one Contact.

Specified by:
getContact in class NativeContactsApi
Parameters:
nabContactId - Native ID for the contact
Returns:
A ContactChange array with contact's data or null
See Also:
NativeContactsApi.getContact(long)

addContact

public ContactChange[] addContact(NativeContactsApi.Account account,
                                  ContactChange[] ccList)
Description copied from class: NativeContactsApi
Adds a contact. Note that the returned ID data will be the same size of ccList plus one change containing the NAB Contact ID (at the first position). The remaining IDs correspond to the details in the original change list. Null IDs among these remaining IDs are possible when these correspond to unsupported details. On 1.X Devices only a null account parameter is expected.

Specified by:
addContact in class NativeContactsApi
Parameters:
account - Account to be associated with the added contact (may be null).
ccList - The Contact data as a ContactChange array
Returns:
A ContactChange array with contact's new ID data or null in case of failure.
See Also:
NativeContactsApi.addContact(Account, ContactChange[])

updateContact

public ContactChange[] updateContact(ContactChange[] ccList)
Description copied from class: NativeContactsApi
Updates an existing contact. The returned ID data will be the same size of the ccList. However, if a null or empty ccList is passed as an argument then null is returned. Null IDs among the ID data are also possible when these correspond to unsupported details.

Specified by:
updateContact in class NativeContactsApi
Parameters:
ccList - The Contact update data as a ContactChange array
Returns:
A ContactChange array with the contact's new ID data or null
See Also:
NativeContactsApi.updateContact(ContactChange[])

removeContact

public void removeContact(long nabContactId)
Description copied from class: NativeContactsApi
Removes a contact

Specified by:
removeContact in class NativeContactsApi
Parameters:
nabContactId - Native ID of the contact to remove
See Also:
NativeContactsApi.removeContact(long)

isKeySupported

public boolean isKeySupported(int key)
Description copied from class: NativeContactsApi
Checks whether or not a ContactChange key is supported. Results may vary in 1.X and 2.X

Specified by:
isKeySupported in class NativeContactsApi
Parameters:
key - Key to check for support
Returns:
true if supported, false if not
See Also:
NativeContactsApi.isKeySupported(int)

getContactIds

private long[] getContactIds(java.lang.String selection)
Inner (private) method for getting contact ids. Allows a cleaner separation the public API method.

Parameters:
selection - The where clause for the operation
Returns:
An array containing the Contact IDs that have been found

fetchMyContactsGroupRowIds

private void fetchMyContactsGroupRowIds()
Fetches the IDs corresponding to the "My Contacts" System Group The reason why we return an array is because there may be multiple "My Contacts" groups.


isContactInMyContactsGroup

private boolean isContactInMyContactsGroup(long nabContactId)
Checks if a Contact is in the "My Contacts" System Group

Parameters:
nabContactId - ID of the Contact to check
Returns:
true if the Contact is in the Group, false if not

readDetail

private void readDetail(Cursor cursor,
                        java.util.List<ContactChange> ccList,
                        long nabContactId)
Reads a Contact Detail from a Cursor into the supplied Contact Change List.

Parameters:
cursor - Cursor to read from
ccList - List of Contact Changes to read Detail into
nabContactId - NAB ID of the Contact

readName

private void readName(Cursor cursor,
                      java.util.List<ContactChange> ccList,
                      long nabContactId)
Reads an name detail as a ContactChange from the provided cursor. For this type of detail we need to use a VCARD (semicolon separated) value.

Parameters:
cursor - Cursor to read from
ccList - List of Contact Changes to add read detail data
nabContactId - ID of the NAB Contact

readNickname

private void readNickname(Cursor cursor,
                          java.util.List<ContactChange> ccList,
                          long nabContactId)
Reads an nickname detail as a ContactChange from the provided cursor.

Parameters:
cursor - Cursor to read from
ccList - List of Contact Changes to add read detail data
nabContactId - ID of the NAB Contact

readPhone

private void readPhone(Cursor cursor,
                       java.util.List<ContactChange> ccList,
                       long nabContactId)
Reads an phone detail as a ContactChange from the provided cursor.

Parameters:
cursor - Cursor to read from
ccList - List of Contact Changes to add read detail data
nabContactId - ID of the NAB Contact

readEmail

private void readEmail(Cursor cursor,
                       java.util.List<ContactChange> ccList,
                       long nabContactId)
Reads an email detail as a ContactChange from the provided cursor.

Parameters:
cursor - Cursor to read from
ccList - List of Contact Changes to add read detail data
nabContactId - ID of the NAB Contact

readAddress

private void readAddress(Cursor cursor,
                         java.util.List<ContactChange> ccList,
                         long nabContactId)
Reads an address detail as a ContactChange from the provided cursor. For this type of detail we need to use a VCARD (semicolon separated) value.

Parameters:
cursor - Cursor to read from
ccList - List of Contact Changes to add read detail data
nabContactId - ID of the NAB Contact

readOrganization

private void readOrganization(Cursor cursor,
                              java.util.List<ContactChange> ccList,
                              long nabContactId)
Reads an organization detail as a ContactChange from the provided cursor. For this type of detail we need to use a VCARD (semicolon separated) value. In reality two different changes may be read if a title is also present.

Parameters:
cursor - Cursor to read from
ccList - List of Contact Changes to add read detail data
nabContactId - ID of the NAB Contact

readWebsite

private void readWebsite(Cursor cursor,
                         java.util.List<ContactChange> ccList,
                         long nabContactId)
Reads an Website detail as a ContactChange from the provided cursor.

Parameters:
cursor - Cursor to read from
ccList - List of Contact Changes to add read detail data
nabContactId - ID of the NAB Contact

readBirthday

public void readBirthday(Cursor cursor,
                         java.util.List<ContactChange> ccList,
                         long nabContactId)
Reads an Birthday detail as a ContactChange from the provided cursor. Note that since the Android Type is the Generic "Event", it may be the case that nothing is read if this is not actually a Birthday

Parameters:
cursor - Cursor to read from
ccList - List of Contact Changes to add read detail data
nabContactId - ID of the NAB Contact

addValuesToBatch

private void addValuesToBatch(long nabContactId)
Adds current values to the batch.

Parameters:
nabContactId - The existing NAB Contact ID if it is an update or an invalid id if a new contact

addUpdateValuesToBatch

private void addUpdateValuesToBatch(long nabDetailId)
Adds current update values to the batch.

Parameters:
nabDetailId - The NAB ID of the detail to update

addDeleteDetailToBatch

private void addDeleteDetailToBatch(long nabDetailId)
Adds a delete detail operation to the batch.

Parameters:
nabDetailId - The NAB Id of the detail to delete

addProfileAction

private void addProfileAction(long internalContactId)
Adds the profile action detail to a (assumed) pending new Contact Batch operation.

Parameters:
internalContactId - The Internal Contact ID used as the Profile ID

putDetail

private void putDetail(ContactChange cc)
Put values for a detail from a ContactChange into pending values.

Parameters:
cc - ContactChange to read values from

putName

private void putName(ContactChange cc)
Put Name detail into the values

Parameters:
cc - ContactChange to read values from

putNickname

private void putNickname(ContactChange cc)
Put Nickname detail into the values

Parameters:
cc - ContactChange to read values from

putPhone

private void putPhone(ContactChange cc)
Put Phone detail into the values

Parameters:
cc - ContactChange to read values from

putEmail

private void putEmail(ContactChange cc)
Put Email detail into the values

Parameters:
cc - ContactChange to read values from

putAddress

private void putAddress(ContactChange cc)
Put Address detail into the values

Parameters:
cc - ContactChange to read values from

putWebsite

private void putWebsite(ContactChange cc)
Put Website detail into the values

Parameters:
cc - ContactChange to read values from

putNote

private void putNote(ContactChange cc)
Put Note detail into the values

Parameters:
cc - ContactChange to read values from

putBirthday

private void putBirthday(ContactChange cc)
Put Birthday detail into the values

Parameters:
cc - ContactChange to read values from

putOrganization

private void putOrganization(ContactChange[] ccList)
Put Organization detail into the values

Parameters:
cc - ContactChange to read values from

updateOrganization

private void updateOrganization(ContactChange[] ccList,
                                long nabContactId)
Updates the Organization detail in the context of a Contact Update operation. The end of result of this is that the Organization may be inserted, updated or deleted depending on the update data. For example, if the title is deleted but there is also a company name then the Organization is just updated. However, if there was no company name then the detail should be deleted altogether.

Parameters:
ccList - ContactChange list where Organization and Title may be found
nabContactId - The NAB ID of the Contact

executeNewContactBatch

private ContactChange[] executeNewContactBatch(ContactChange[] ccList)
Executes a pending Batch Operation related to adding a new Contact.

Parameters:
ccList - The original ContactChange for the new Contact
Returns:
ContactChange array containing new IDs (may contain some null elements)

executeUpdateContactBatch

private ContactChange[] executeUpdateContactBatch(ContactChange[] ccList)
Executes a pending Batch Operation related to updating a Contact.

Parameters:
ccList - The original ContactChange for the Contact update
Returns:
ContactChange array containing new IDs (may contain some null elements)

addCallerIsSyncAdapterParameter

private static Uri addCallerIsSyncAdapterParameter(Uri uri)
Static utility method that adds the Sync Adapter flag to the provided URI

Parameters:
uri - URI to add the flag to
Returns:
URI with the flag

mapFromNabPhoneType

private static int mapFromNabPhoneType(int nabType)
Maps a phone type from the native value to the ContactChange flags.

Parameters:
nabType - Given native phone number type
Returns:
ContactChange flags

mapToNabPhoneType

private static int mapToNabPhoneType(int flags)
Maps ContactChange flags into the native phone type.

Parameters:
flags - ContactChange flags
Returns:
Native phone type

mapFromNabEmailType

private static int mapFromNabEmailType(int nabType)
Maps a email type from the native value into the ContactChange flags

Parameters:
nabType - Native email type
Returns:
ContactChange flags

mapToNabEmailType

private static int mapToNabEmailType(int flags)
Maps ContactChange flags into the native email type.

Parameters:
flags - ContactChange flags
Returns:
Native email type

mapFromNabAddressType

private static int mapFromNabAddressType(int nabType)
Maps a address type from the native value into the ContactChange flags

Parameters:
nabType - Native email type
Returns:
ContactChange flags

mapToNabAddressType

private static int mapToNabAddressType(int flags)
Maps ContactChange flags into the native address type.

Parameters:
flags - ContactChange flags
Returns:
Native address type

mapFromNabOrganizationType

private static int mapFromNabOrganizationType(int nabType)
Maps a organization type from the native value into the ContactChange flags

Parameters:
nabType - Given native organization type
Returns:
ContactChange flags

mapToNabOrganizationType

private static int mapToNabOrganizationType(int flags)
Maps ContactChange flags into the native organization type.

Parameters:
flags - ContactChange flags
Returns:
Native Organization type

mapFromNabWebsiteType

private static int mapFromNabWebsiteType(int nabType)
Maps a Website type from the native value into the ContactChange flags

Parameters:
nabType - Native email type
Returns:
ContactChange flags

mapToNabWebsiteType

private static int mapToNabWebsiteType(int flags)
Maps ContactChange flags into the native Website type.

Parameters:
flags - ContactChange flags
Returns:
Native Website type


JavaDoc