|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object SQLiteOpenHelper com.vodafone360.people.database.DatabaseHelper
public class DatabaseHelper
The main interface to the client database.
The DATABASE_VERSION
field must be increased each time any change is
made to the database schema. This includes any changes to the table name or
fields in table classes and any change to persistent settings.
All database functionality should be implemented in one of the table Table or Utility sub classes
Nested Class Summary | |
---|---|
static class |
DatabaseHelper.DatabaseChangeType
An instance of this enum is passed to database change listeners to define the database change type. |
static class |
DatabaseHelper.ServerIdInfo
Used for passing server contact IDs around. |
static class |
DatabaseHelper.ThumbnailInfo
Used for passing contact avatar information around. |
Field Summary | |
---|---|
private static java.lang.String |
DATABASE_NAME
The name of the database file. |
static java.lang.String |
DATABASE_PRESENCE
The name of the presence database file which is in memory. |
private static int |
DATABASE_VERSION
Contains the database version. |
private static java.lang.String |
LOG_TAG
|
private Context |
mContext
|
private boolean |
mDbUpgradeRequired
|
private boolean |
mMeProfileAvatarChangedFlag
|
private java.util.List<Handler> |
mUiEventCallbackList
|
private static java.lang.String |
QUERY_NATIVE_SYNCABLE_CONTACTS_LOCAL_IDS
SELECT DISTINCT LocalId FROM NativeChangeLog UNION SELECT DISTINCT LocalId FROM ContactDetails WHERE NativeSyncId IS NULL OR NativeSyncId <> -1 ORDER BY 1 |
Constructor Summary | |
---|---|
DatabaseHelper(Context context)
Public Constructor. |
|
DatabaseHelper(Context context,
java.lang.String name)
Constructor. |
Method Summary | |
---|---|
ServiceStatus |
addActivities(java.util.List<ActivityItem> activityList)
Add a list of new activities to the Activities table. |
ServiceStatus |
addContact(Contact contact)
Adds a contact to the database and fires an internal database change event. |
ServiceStatus |
addContactDetail(ContactDetail detail)
Adds a contact detail to the database and fires an internal database change event. |
ServiceStatus |
addContactToGroup(long localContactId,
long groupId)
Puts a contact into a group. |
void |
addEventCallback(Handler uiHandler)
Add a database change listener. |
boolean |
addNativeContact(ContactChange[] contact)
Adds a native contact to the people database and makes sure that the related tables are updated (Contact, ContactDetail, ContactSummary and Activities). |
ServiceStatus |
addTimelineEvents(java.util.ArrayList<ActivitiesTable.TimelineSummaryItem> syncItemList,
boolean isCallLog)
Add timeline events to the database. |
ContactDetail |
convertContactChange(ContactChange change)
Converts a ContactChange object into an equivalent ContactDetail object. |
private Contact |
convertNativeContactChanges(ContactChange[] contactChanges)
Converts an array of ContactChange into a Contact object. |
java.lang.String |
copyDatabaseToSd(java.lang.String info)
Copies a snapshot of the database to the SD Card - Used for testing only. |
static java.lang.String |
createWhereClauseFromList(java.lang.String field,
java.lang.Object[] itemList,
java.lang.String clause)
Utility function to create a where clause string from a list of conditions. |
ServiceStatus |
deleteActivities(java.lang.Integer flag)
Removes all the status or timeline activities from the database. |
ServiceStatus |
deleteAllGroups()
Removes all groups from the database. |
ServiceStatus |
deleteContact(long localContactID)
Deletes a contact from the database and fires an internal database change event. |
boolean |
deleteContactChanges(java.util.List<ContactChangeLogTable.ContactChangeInfo> changeInfoList)
Remove contact changes from the change log. |
ServiceStatus |
deleteContactDetail(long localContactDetailID)
Deletes a contact detail from the database. |
ServiceStatus |
deleteContactFromGroup(long localContactId,
long groupId)
Removes a group from a contact. |
private void |
deleteDatabase()
Deletes the database and then fires a Database Changed Event to the UI. |
private static boolean |
deleteDirectory(java.io.File path)
Deletes a directory and all its contents including sub-directories. |
private boolean |
deleteThumbnail(java.lang.Long localContactID)
Deletes a given Thumbnail |
ServiceStatus |
deleteTimelineActivity(MainApplication mApplication,
ActivitiesTable.TimelineSummaryItem timelineItem,
boolean isTimelineAll)
Removes the selected timeline activity from the database. |
static boolean |
doDetailsMatch(ContactDetail d1,
ContactDetail d2)
Utility function which compares two contact details to determine if they refer to the same detail (the values may be different). |
ServiceStatus |
fetchActivitiesIds(java.util.List<java.lang.Long> activityIdList,
java.lang.Long timeStamp)
Fetches a list of activity IDs from a given time. |
private ServiceStatus |
fetchBaseContact(long localContactId,
Contact baseContact,
SQLiteDatabase mDb)
Fetches the outer contact object information (no details, groups or sources are included). |
ServiceStatus |
fetchContact(long localContactId,
Contact contact)
Fetches a contact from the database by its localContactId. |
ServiceStatus |
fetchContactByServerId(java.lang.Long contactServerId,
Contact contact)
Fetches a contact, given a server Id. |
ServiceStatus |
fetchContactDetail(long localDetailId,
ContactDetail detail)
Fetches a contact detail from the database. |
ServiceStatus |
fetchContactInfo(java.lang.String phoneNumber,
Contact contact,
ContactDetail phoneDetail)
Searches the database for a contact with a given phone number. |
java.util.List<Contact> |
fetchContactList()
|
ServiceStatus |
fetchLogonCredentials(LoginDetails details)
Fetches the user's logon credentials from the database. |
ServiceStatus |
fetchLogonCredentialsAndPublicKey(LoginDetails details,
PublicKeyDetails pubKeyDetails)
Fetches the user's logon credentials and public key information from the database. |
PersistSettings |
fetchOption(PersistSettings.Option option)
Fetches a setting from the database. |
java.lang.Long |
fetchServerId(long localContactId)
Fetches the server Id of a contact. |
int |
fetchThumbnailUrlCount()
Fetches the number of Contact Avatars which have not yet been loaded. |
ServiceStatus |
fetchThumbnailUrls(java.util.List<DatabaseHelper.ThumbnailInfo> thumbInfoList,
int firstIndex,
int count)
Fetches Avatar URLs from the database for all contacts which have an Avatar and have not yet been loaded. |
ServiceStatus |
fetchThumbnailUrlsForContacts(java.util.List<DatabaseHelper.ThumbnailInfo> thumbInfoList,
java.util.List<Contact> contactList)
Fetches Avatar URLs from the database for all contacts from contactList which have an Avatar and have not yet been loaded. |
Cursor |
fetchTimelineEvents(java.lang.Long timeStamp,
ActivitiesTable.TimelineNativeTypes[] types)
Fetches timeline events from a given time. |
boolean |
findNativeContact(Contact c)
find the native contact in the database. |
void |
fireDatabaseChangedEvent(DatabaseHelper.DatabaseChangeType type,
boolean isExternal)
Fetches fires a database change event to the listeners. |
private void |
fireEventToUi(ServiceUiRequest event,
int arg1,
int arg2,
java.lang.Object data)
Internal function to send an event to all the listeners. |
private void |
fireSettingChangedEvent(PersistSettings setting)
Internal function to fire a setting changed event to listeners. |
long[] |
getNativeSyncableContactsLocalIds()
|
static boolean |
hasDetailChanged(ContactDetail currentDetail,
ContactDetail newDetail)
Utility function which compares two contact details to determine if they have the same value. |
boolean |
isMeProfileAvatarChanged()
Determines if the me profile avatar needs to be uploaded onto the server. |
void |
markMeProfileAvatarChanged()
Stores a flag in the database indicating that the me profile avatar has changed. |
ServiceStatus |
modifyContactDetail(ContactDetail detail)
Modifies an existing contact detail in the database. |
boolean |
modifyContactDetailServerId(java.lang.Long localDetailId,
java.lang.Long serverDetailId)
Modifies the Detail Id stored in the database for a specific contact detail. |
boolean |
modifyContactServerId(long localId,
java.lang.Long serverId,
java.lang.Long userId)
Modifies the server Contact Id and User ID stored in the database for a specific contact. |
ServiceStatus |
modifyCredentials(LoginDetails details)
Modifies the user's logon credentials. |
ServiceStatus |
modifyCredentialsAndPublicKey(LoginDetails details,
PublicKeyDetails pubKeyDetails)
Modifies the user's logon credentials and public key details. |
ServiceStatus |
modifyMeProfileAvatarChangedFlag(boolean avatarChanged)
Modifies the Me Profile Avatar Changed Flag. |
void |
onCreate(SQLiteDatabase db)
Called the first time the database is generated to create all tables. |
void |
onOpen(SQLiteDatabase db)
Called whenever the database is opened. |
void |
onUpgrade(SQLiteDatabase db,
int oldVersion,
int newVersion)
Delete and then recreate a newer database structure. |
Cursor |
openContactsCursor(java.lang.Long groupFilterId,
java.lang.CharSequence constraint)
|
Cursor |
openContactSummaryCursor(java.lang.Long groupFilterId,
java.lang.CharSequence constraint)
Fetches a cursor which can be used to iterate through the main contact list. |
void |
removeEventCallback(Handler uiHandler)
Removes a database change listener. |
void |
removeUserData()
Remove all user data (Thumbnails, Database, Flags) from the device and notifies the engine manager. |
private void |
setInternalContactId(ContactChange[] contact,
long internalContactId)
Sets the internalContactId for all the ContactChange provided. |
ServiceStatus |
setOption(PersistSettings setting)
Modifies a setting in the database. |
void |
start()
Called when the Application is first started. |
ServiceStatus |
syncAddContactDetailList(java.util.List<ContactDetail> detailList,
boolean syncToServer,
boolean syncToNative)
Function used by the contact sync engine to add a list of contact details to the database. |
ServiceStatus |
syncAddContactList(java.util.List<Contact> contactList,
boolean syncToServer,
boolean syncToNative)
Function used by the contact sync engine to add a list of contacts to the database. |
ServiceStatus |
syncDeleteContactDetailList(java.util.List<ContactDetail> contactDetailList,
boolean syncToServer,
boolean syncToNative)
Function used by the contact sync engine to delete a list of contact details from the database. |
ServiceStatus |
syncDeleteContactList(java.util.List<ContactsTable.ContactIdInfo> contactIdList,
boolean syncToServer,
boolean syncToNative)
Function used by the contact sync engine to delete a list of contacts from the database. |
ServiceStatus |
syncModifyContactDetailList(java.util.List<ContactDetail> contactDetailList,
boolean syncToServer,
boolean syncToNative)
Function used by the contact sync engine to modify a list of contact details in the database. |
ServiceStatus |
syncModifyContactList(java.util.List<Contact> contactList,
boolean syncToServer,
boolean syncToNative)
Function used by the contact sync engine to modify a list of contacts in the database. |
static void |
trace(boolean write,
java.lang.String input)
Logs Database activity when the Settings.ENABLED_DATABASE_TRACE flag is set to true. |
ServiceStatus |
updateNameAndStatusInSummary(SQLiteDatabase writableDatabase,
long localContactId)
Updates the ContactSummary table with the new/changed Contact |
private boolean |
updateTimelineAndContactSummaryWithLegacyCode(Contact contact,
SQLiteDatabase writableDb)
Updates the Timeline and ContactSummary tables with a new contact. |
private void |
updateTimelineNames(ContactDetail cd,
SQLiteDatabase db)
Updates the contents of the activities table when a contact detail changes. |
private void |
updateTimelineNames(ContactDetail cd,
java.lang.String contactFriendlyName,
java.lang.Long serverId,
SQLiteDatabase db)
Updates the contents of the activities table when a contact detail changes. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private static final java.lang.String LOG_TAG
private static final java.lang.String DATABASE_NAME
public static final java.lang.String DATABASE_PRESENCE
private static final int DATABASE_VERSION
private final java.util.List<Handler> mUiEventCallbackList
private Context mContext
private boolean mMeProfileAvatarChangedFlag
private boolean mDbUpgradeRequired
private static final java.lang.String QUERY_NATIVE_SYNCABLE_CONTACTS_LOCAL_IDS
Constructor Detail |
---|
public DatabaseHelper(Context context)
context
- Android contextpublic DatabaseHelper(Context context, java.lang.String name)
context
- the Context where to create the databasename
- the name of the databaseMethod Detail |
---|
public void onCreate(SQLiteDatabase db)
db
- An open SQLite database objectpublic void onOpen(SQLiteDatabase db)
db
- An open SQLite database objectpublic void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion)
db
- An open SQLite database objectoldVersion
- The current database version on the devicenewVersion
- The required database versionprivate void deleteDatabase()
public void start()
public ServiceStatus addContact(Contact contact)
contact
- A Contact
object which contains the details to be
added
deleteContact(long)
,
addContactDetail(ContactDetail)
,
modifyContactDetail(ContactDetail)
,
deleteContactDetail(long)
,
addContactToGroup(long, long)
,
deleteContactFromGroup(long, long)
public ServiceStatus deleteContact(long localContactID)
localContactID
- The local ID of the contact to delete
addContact(Contact)
,
addContactDetail(ContactDetail)
,
modifyContactDetail(ContactDetail)
,
deleteContactDetail(long)
,
addContactToGroup(long, long)
,
deleteContactFromGroup(long, long)
public ServiceStatus addContactDetail(ContactDetail detail)
detail
- A ContactDetail
object which contains the detail to
add
java.lang.NullPointerException
- When detail is NULLmodifyContactDetail(ContactDetail)
,
deleteContactDetail(long)
,
addContact(Contact)
,
deleteContact(long)
,
addContactToGroup(long, long)
,
deleteContactFromGroup(long, long)
public ServiceStatus modifyContactDetail(ContactDetail detail)
detail
- A ContactDetail
object which contains the detail to
add
addContactDetail(ContactDetail)
,
deleteContactDetail(long)
,
addContact(Contact)
,
deleteContact(long)
,
addContactToGroup(long, long)
,
deleteContactFromGroup(long, long)
public ServiceStatus deleteContactDetail(long localContactDetailID)
localContactDetailID
- The local ID of the detail to delete
addContactDetail(ContactDetail)
,
modifyContactDetail(ContactDetail)
,
addContact(Contact)
,
deleteContact(long)
,
addContactToGroup(long, long)
,
deleteContactFromGroup(long, long)
public boolean modifyContactServerId(long localId, java.lang.Long serverId, java.lang.Long userId)
localId
- The local Id of the contact to modifyserverId
- The new server IduserId
- The new user Id
fetchContactByServerId(Long, Contact)
,
fetchServerId(long)
public boolean modifyContactDetailServerId(java.lang.Long localDetailId, java.lang.Long serverDetailId)
localDetailId
- The local Id of the contact detail to modifyserverDetailId
- The new server Id
public ServiceStatus fetchLogonCredentials(LoginDetails details)
details
- An empty LoginDetails object which will be filled on
return
fetchLogonCredentialsAndPublicKey(LoginDetails, PublicKeyDetails)
,
modifyCredentials(LoginDetails)
,
modifyCredentialsAndPublicKey(LoginDetails, PublicKeyDetails)
public ServiceStatus fetchLogonCredentialsAndPublicKey(LoginDetails details, PublicKeyDetails pubKeyDetails)
details
- An empty LoginDetails object which will be filled on
returnpubKeyDetails
- An empty PublicKeyDetails object which will be
filled on return
fetchLogonCredentials(LoginDetails)
,
modifyCredentials(LoginDetails)
,
modifyCredentialsAndPublicKey(LoginDetails, PublicKeyDetails)
public ServiceStatus modifyCredentials(LoginDetails details)
details
- The login details to store
fetchLogonCredentials(LoginDetails)
,
fetchLogonCredentialsAndPublicKey(LoginDetails, PublicKeyDetails)
,
modifyCredentialsAndPublicKey(LoginDetails, PublicKeyDetails)
public ServiceStatus modifyCredentialsAndPublicKey(LoginDetails details, PublicKeyDetails pubKeyDetails)
details
- The login details to storepubKeyDetails
- The public key details to store
fetchLogonCredentials(LoginDetails)
,
fetchLogonCredentialsAndPublicKey(LoginDetails, PublicKeyDetails)
,
modifyCredentials(LoginDetails)
public boolean deleteContactChanges(java.util.List<ContactChangeLogTable.ContactChangeInfo> changeInfoList)
changeInfoList
- A list of changeInfoIDs (none of the other fields
in the ContactChangeLogTable.ContactChangeInfo
object are required).
public PersistSettings fetchOption(PersistSettings.Option option)
option
- The option required.
PersistSettings
object which contains the setting data
if successful, null otherwisesetOption(PersistSettings)
public ServiceStatus setOption(PersistSettings setting)
setting
- A PersistSetting
object which is populated with an
option set to a value.
fetchOption(com.vodafone360.people.service.PersistSettings.Option)
public ServiceStatus deleteAllGroups()
public ServiceStatus fetchThumbnailUrls(java.util.List<DatabaseHelper.ThumbnailInfo> thumbInfoList, int firstIndex, int count)
thumbInfoList
- An empty list where the DatabaseHelper.ThumbnailInfo
objects will be stored containing the URLsfirstIndex
- The 0-based index of the first item to fetch from the
databasecount
- The maximum number of items to fetch
DatabaseHelper.ThumbnailInfo
,
fetchThumbnailUrlCount()
public ServiceStatus fetchThumbnailUrlsForContacts(java.util.List<DatabaseHelper.ThumbnailInfo> thumbInfoList, java.util.List<Contact> contactList)
thumbInfoList
- An empty list where the DatabaseHelper.ThumbnailInfo
objects will be stored containing the URLscontactList
- list of contacts to fetch the thumbnails for
DatabaseHelper.ThumbnailInfo
,
fetchThumbnailUrlCount()
public int fetchThumbnailUrlCount()
DatabaseHelper.ThumbnailInfo
,
fetchThumbnailUrls(List, int, int)
public ServiceStatus modifyMeProfileAvatarChangedFlag(boolean avatarChanged)
avatarChanged
- true to set the flag, false to clear the flag
public Cursor openContactSummaryCursor(java.lang.Long groupFilterId, java.lang.CharSequence constraint)
The ContactSummaryTable.getQueryData static method can be used on the cursor returned by this method to create a ContactSummary object.
groupFilterId
- The local ID of a group to filter, or null if no
filter is requiredconstraint
- A search string to filter the contact name, or null if
no filter is required
public Cursor openContactsCursor(java.lang.Long groupFilterId, java.lang.CharSequence constraint)
public ServiceStatus fetchContact(long localContactId, Contact contact)
#fetchBaseContact(long, Contact)
should be used if the contact
details properties are not required.
localContactId
- Local ID of the contact to fetch.contact
- Empty Contact
object which will be populated with
data.
public ServiceStatus fetchContactDetail(long localDetailId, ContactDetail detail)
localDetailId
- The local ID of the detail to fetchdetail
- A empty ContactDetail
object which will be filled
with the data
public ServiceStatus fetchContactInfo(java.lang.String phoneNumber, Contact contact, ContactDetail phoneDetail)
phoneNumber
- The telephone number to findcontact
- An empty Contact object which will be filled if a contact
is foundphoneDetail
- An empty ContactDetail
object which will be
filled with the matching phone number detail
public ServiceStatus addContactToGroup(long localContactId, long groupId)
localContactId
- The local Id of the contactgroupId
- The local group Id
deleteContactFromGroup(long, long)
public ServiceStatus deleteContactFromGroup(long localContactId, long groupId)
localContactId
- The local Id of the contactgroupId
- The local group Id
addContactToGroup(long, long)
public ServiceStatus deleteActivities(java.lang.Integer flag)
flag
- The type of activity to delete or null to delete all
addActivities(List)
,
addTimelineEvents(ArrayList, boolean)
,
fetchActivitiesIds(List, Long)
,
fetchTimelineEvents(Long,
com.vodafone360.people.database.tables.ActivitiesTable.TimelineNativeTypes[])
public ServiceStatus deleteTimelineActivity(MainApplication mApplication, ActivitiesTable.TimelineSummaryItem timelineItem, boolean isTimelineAll)
mApplication
- The MainApplicationtimelineItem
- TimelineSummaryItem to be deleted
public ServiceStatus addActivities(java.util.List<ActivityItem> activityList)
activityList
- contains the list of activity item
deleteActivities(Integer)
,
addTimelineEvents(ArrayList, boolean)
public ServiceStatus fetchActivitiesIds(java.util.List<java.lang.Long> activityIdList, java.lang.Long timeStamp)
activityIdList
- an empty list to be populatedtimeStamp
- The oldest time that should be included in the list
fetchTimelineEvents(Long,
com.vodafone360.people.database.tables.ActivitiesTable.TimelineNativeTypes[])
public Cursor fetchTimelineEvents(java.lang.Long timeStamp, ActivitiesTable.TimelineNativeTypes[] types)
timeStamp
- The oldest time that should be included in the listtypes
- A list of required timeline types (or an empty list for all)
addTimelineEvents(ArrayList, boolean)
,
fetchActivitiesIds(List, Long)
public void fireDatabaseChangedEvent(DatabaseHelper.DatabaseChangeType type, boolean isExternal)
type
- The type of database change (contacts, activity, etc)isExternal
- true if this change came from the server, false if the
change is from the clientaddEventCallback(Handler)
,
removeEventCallback(Handler)
,
fireSettingChangedEvent(PersistSettings)
public void addEventCallback(Handler uiHandler)
uiHandler
- The handler which will be notifiedfireDatabaseChangedEvent(DatabaseChangeType, boolean)
,
fireSettingChangedEvent(PersistSettings)
public void removeEventCallback(Handler uiHandler)
uiHandler
- The handler which will be notifiedaddEventCallback(Handler)
private void fireSettingChangedEvent(PersistSettings setting)
setting
- The setting that has changed with the new dataaddEventCallback(Handler)
,
removeEventCallback(Handler)
,
fireDatabaseChangedEvent(DatabaseChangeType, boolean)
private void fireEventToUi(ServiceUiRequest event, int arg1, int arg2, java.lang.Object data)
event
- The type of eventarg1
- This value depends on the type of eventarg2
- This value depends on the type of eventdata
- This value depends on the type of eventfireDatabaseChangedEvent(DatabaseChangeType, boolean)
,
fireSettingChangedEvent(PersistSettings)
public ServiceStatus syncAddContactList(java.util.List<Contact> contactList, boolean syncToServer, boolean syncToNative)
contactList
- The list of contacts received from the serversyncToServer
- true if the contacts need to be sent to the serversyncToNative
- true if the contacts need to be added to the native
phonebook
addContact(Contact)
public ServiceStatus syncModifyContactList(java.util.List<Contact> contactList, boolean syncToServer, boolean syncToNative)
contactList
- The list of contacts received from the serversyncToServer
- true if the contacts need to be sent to the serversyncToNative
- true if the contacts need to be modified in the
native phonebook
public ServiceStatus syncDeleteContactList(java.util.List<ContactsTable.ContactIdInfo> contactIdList, boolean syncToServer, boolean syncToNative)
contactIdList
- The list of contact IDs received from the server (at
least localId should be set)syncToServer
- true if the contacts need to be deleted from the
serversyncToNative
- true if the contacts need to be deleted from the
native phonebook
deleteContact(long)
public ServiceStatus syncAddContactDetailList(java.util.List<ContactDetail> detailList, boolean syncToServer, boolean syncToNative)
detailList
- The list of details received from the serversyncToServer
- true if the details need to be sent to the serversyncToNative
- true if the contacts need to be added to the native
phonebook
addContactDetail(ContactDetail)
private void updateTimelineNames(ContactDetail cd, SQLiteDatabase db)
cd
- The new or modified contact detaildb
- Writable SQLite database for the updateprivate void updateTimelineNames(ContactDetail cd, java.lang.String contactFriendlyName, java.lang.Long serverId, SQLiteDatabase db)
cd
- The new or modified contact detailcontactFriendlyName
- Name of contact (if known)serverId
- if knowndb
- Writable SQLite database for the updatepublic ServiceStatus syncModifyContactDetailList(java.util.List<ContactDetail> contactDetailList, boolean syncToServer, boolean syncToNative)
contactDetailList
- The list of details received from the serverserverIdList
- A list of server IDs if known, or nullsyncToServer
- true if the details need to be sent to the serversyncToNative
- true if the contacts need to be added to the native
phonebook
modifyContactDetail(ContactDetail)
public ServiceStatus syncDeleteContactDetailList(java.util.List<ContactDetail> contactDetailList, boolean syncToServer, boolean syncToNative)
contactDetailList
- The list of details which has been deleted on
the serverserverIdList
- A list of server IDs if known, or nullsyncToServer
- true if the details need to be sent to the serversyncToNative
- true if the contacts need to be added to the native
phonebook
deleteContactDetail(long)
private ServiceStatus fetchBaseContact(long localContactId, Contact baseContact, SQLiteDatabase mDb)
localContactId
- The local ID of the contact to fetchbaseContact
- An empty Contact object which will be filled with the
data
fetchContact(long, Contact)
public java.lang.Long fetchServerId(long localContactId)
localContactId
- The local ID of the contact
fetchContactByServerId(Long, Contact)
,
modifyContactServerId(long, Long, Long)
public void removeUserData()
private boolean deleteThumbnail(java.lang.Long localContactID)
localContactID
- The local Id of the contact with the Thumbnailpublic ServiceStatus fetchContactByServerId(java.lang.Long contactServerId, Contact contact)
contactServerId
- The server ID of the contact to fetchcontact
- An empty Contact object which will be filled with the data
modifyContactServerId(long, Long, Long)
,
fetchServerId(long)
public static boolean doDetailsMatch(ContactDetail d1, ContactDetail d2)
d1
- The first contact detail to compared2
- The second contact detail to compare
hasDetailChanged(ContactDetail, ContactDetail)
public static boolean hasDetailChanged(ContactDetail currentDetail, ContactDetail newDetail)
currentDetail
- The first contact detail to comparenewDetail
- The second contact detail to compare
doDetailsMatch(ContactDetail, ContactDetail)
public ServiceStatus addTimelineEvents(java.util.ArrayList<ActivitiesTable.TimelineSummaryItem> syncItemList, boolean isCallLog)
syncItemList
- The list of items to be addedisCallLog
- true if the list has come from the call-log, false
otherwise
addTimelineEvents(ArrayList, boolean)
,
deleteActivities(Integer)
,
fetchActivitiesIds(List, Long)
,
fetchTimelineEvents(Long,
com.vodafone360.people.database.tables.ActivitiesTable.TimelineNativeTypes[])
public static java.lang.String createWhereClauseFromList(java.lang.String field, java.lang.Object[] itemList, java.lang.String clause)
field
- The name of the table field to be compareditemList
- The list of items to be compared against the fieldclause
- This can be "AND", "OR" or any other SQL clause
public boolean isMeProfileAvatarChanged()
modifyMeProfileAvatarChangedFlag(boolean)
public static void trace(boolean write, java.lang.String input)
write
- true if this is debug trace, false otherwiseinput
- String to Log at Info levelpublic java.lang.String copyDatabaseToSd(java.lang.String info)
private static boolean deleteDirectory(java.io.File path)
path
- file location
public boolean findNativeContact(Contact c)
c
- contact
public void markMeProfileAvatarChanged()
public ServiceStatus updateNameAndStatusInSummary(SQLiteDatabase writableDatabase, long localContactId)
public java.util.List<Contact> fetchContactList()
public boolean addNativeContact(ContactChange[] contact)
contact
- the contact to add
private boolean updateTimelineAndContactSummaryWithLegacyCode(Contact contact, SQLiteDatabase writableDb)
contact
- the contact to take info fromwritableDb
- the db to use to write the updates
private void setInternalContactId(ContactChange[] contact, long internalContactId)
contact
- the array of ContactChange to updateinternalContactId
- the id to setprivate Contact convertNativeContactChanges(ContactChange[] contactChanges)
contactChanges
- the array of ContactChange to convert
ContactChange
,
Contact
public ContactDetail convertContactChange(ContactChange change)
change
- the ContactChange to convert
ContactChange
,
ContactDetail
public long[] getNativeSyncableContactsLocalIds()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
JavaDoc