diff options
author | Dave Santoro <dsantoro@google.com> | 2011-07-13 14:03:53 -0700 |
---|---|---|
committer | Dave Santoro <dsantoro@google.com> | 2011-07-27 17:15:46 -0700 |
commit | 43368a3f9e05a979e454e278d6a0e8475f08923d (patch) | |
tree | 3ff616a1aff1af5ea4d18d437b9ac8f2032e985a /src/com/android/providers/contacts/TransactionContext.java | |
parent | 51d1da962292ecef21abdf7e41abfdb7f1d72fcd (diff) | |
download | packages_providers_ContactsProvider-43368a3f9e05a979e454e278d6a0e8475f08923d.tar.gz packages_providers_ContactsProvider-43368a3f9e05a979e454e278d6a0e8475f08923d.tar.bz2 packages_providers_ContactsProvider-43368a3f9e05a979e454e278d6a0e8475f08923d.zip |
Provider and DB changes to support data_set field.
The intent of the data set field is to provide a way for multiple
sync adapters from the same account name + type to manage separate
sets of data in the raw_contacts and groups table.
For example, this would allow for Focus groups to be synced in from
Focus via the Google Contacts sync adapter, and for Google+ Circles
to be synced in from the Google+ app, even though both are tied to
the same account name + type.
Bug 5077096
Change-Id: I641c5d233d8d4d70988d209179c4e79bdb9c7ea1
Diffstat (limited to 'src/com/android/providers/contacts/TransactionContext.java')
-rw-r--r-- | src/com/android/providers/contacts/TransactionContext.java | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/src/com/android/providers/contacts/TransactionContext.java b/src/com/android/providers/contacts/TransactionContext.java index c7eb03cf..a4e8b8be 100644 --- a/src/com/android/providers/contacts/TransactionContext.java +++ b/src/com/android/providers/contacts/TransactionContext.java @@ -19,8 +19,6 @@ package com.android.providers.contacts; import com.google.android.collect.Maps; import com.google.android.collect.Sets; -import android.accounts.Account; - import java.util.HashMap; import java.util.HashSet; import java.util.Map; @@ -33,24 +31,25 @@ import java.util.Set; */ public class TransactionContext { - private HashMap<Long, Account> mInsertedRawContacts = Maps.newHashMap(); + private HashMap<Long, AccountWithDataSet> mInsertedRawContacts = Maps.newHashMap(); private HashSet<Long> mUpdatedRawContacts = Sets.newHashSet(); - private HashMap<Long, Account> mInsertedProfileRawContacts = Maps.newHashMap(); + private HashMap<Long, AccountWithDataSet> mInsertedProfileRawContacts = Maps.newHashMap(); private HashSet<Long> mDirtyRawContacts = Sets.newHashSet(); private HashSet<Long> mStaleSearchIndexRawContacts = Sets.newHashSet(); private HashSet<Long> mStaleSearchIndexContacts = Sets.newHashSet(); private HashMap<Long, Object> mUpdatedSyncStates = Maps.newHashMap(); - public void rawContactInserted(long rawContactId, Account account) { - mInsertedRawContacts.put(rawContactId, account); + public void rawContactInserted(long rawContactId, AccountWithDataSet accountWithDataSet) { + mInsertedRawContacts.put(rawContactId, accountWithDataSet); } public void rawContactUpdated(long rawContactId) { mUpdatedRawContacts.add(rawContactId); } - public void profileRawContactInserted(long rawContactId, Account account) { - mInsertedProfileRawContacts.put(rawContactId, account); + public void profileRawContactInserted(long rawContactId, + AccountWithDataSet accountWithDataSet) { + mInsertedProfileRawContacts.put(rawContactId, accountWithDataSet); } public void markRawContactDirty(long rawContactId) { @@ -77,7 +76,7 @@ public class TransactionContext { return mUpdatedRawContacts; } - public Map<Long, Account> getInsertedProfileRawContactIds() { + public Map<Long, AccountWithDataSet> getInsertedProfileRawContactIds() { return mInsertedProfileRawContacts; } @@ -97,7 +96,7 @@ public class TransactionContext { return mUpdatedSyncStates.entrySet(); } - public Account getAccountForRawContact(long rawContactId) { + public AccountWithDataSet getAccountWithDataSetForRawContact(long rawContactId) { return mInsertedRawContacts.get(rawContactId); } |