History log of /packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactLookupKey.java
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
c5fdfb79564e8b46d6aae213a312d4e1560f3a3c 03-Sep-2011 Dave Santoro <dsantoro@google.com> Fix lookup key generation for inserted profiles.

We were properly updating the lookup key to "profile" on updates,
but the initial insert would still have a regular lookup key, which
would prevent us from identifying it as a profile URI, and in turn
meant that stream items wouldn't show up for the profile.

Bug 5245109

Change-Id: I7c01d051a167214be77bd962901af6cdb6100787
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactLookupKey.java
5d0a768b56ed4bd0dfef81b8389247ba74766659 08-Aug-2011 Dave Santoro <dsantoro@google.com> Separate the profile out into a separate database.

Fundamentally, this works as follows:
1. A separate, structurally identical database is created for
storing profile data. The view columns for identifying whether
a contact or raw contact belongs to the user's profile are
initialized with constant values for each database.
2. Sequence numbers in the new profile database are set to a very
high value (MAX_LONG - MAX_INT) to designate an ID-space in which
profile data is stored. This is important for distinguishing
between contact and profile requests.
3. Contacts Provider URIs are divided into several sets, bucketed
automatically by a new profile-aware URI matcher.
- URIs that explicitly reference the profile.
- URIs that contain IDs (which may be in the profile ID-space).
- URIs that contain lookup keys (which may be a special profile
lookup key).
- URIs for insertion that may contain a profile ID as the parent
for the inserted record (in content values). These can't be
detected by the URI matcher by itself, so this mapping is
maintained in the provider.
By identifying whether a URI falls into one of these sets, the
contacts provider can efficiently determine whether the request
is intended for the profile database or contacts database.
4. The Contacts Provider holds onto two separate copies of the
following, one each for contacts and profiles:
- Database helper
- Transaction context
- Aggregator
- Photo store (the profile one uses a separate directory)
5. During any query/update/insert/delete/openAssetFile operation,
the URI (and content values, if applicable) are examined to
determine whether the operation is intended for the Contacts DB
or the profile DB. If intended for the profile DB, the provider
is switched (in a thread-local manner) to a profile mode, and the
operation is handed off to the profile provider. The profile
provider does a permission check, substitutes the profile database
as the active DB in the contacts provider, and continues the
operation in the Contacts Provider by calling the in-transaction
or local version of the operation, which does its normal
processing, but with everything pointing at profile-specific
databases, aggregators, etc.
6. If the operation isn't determined to be targeted to the profile
database, the provider is similarly switched (thread-locally) into
contacts mode, and the active DB is set to the contacts DB.
7. For batch operations, we only create a transaction for the
contacts DB initially. If any of the operations in the batch end
up targeting the profile DB, we start a transaction for the
profile DB. When the batch is finished, we check for that and
also commit the profile transaction if there were no errors.

Bug 5204577
Bug 5161066
Bug 5155743
Bug 5087853
Bug 5031883
Bug 5198777
Bug 5230140

Change-Id: Ic43a6625cbb6edf52ea076b084647fb0656e28e5
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactLookupKey.java
43368a3f9e05a979e454e278d6a0e8475f08923d 13-Jul-2011 Dave Santoro <dsantoro@google.com> 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
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactLookupKey.java
51698db0c97b20e95421bc42b243e4ea315137be 16-Mar-2010 Dmitri Plotnikov <dplotnikov@google.com> Fixing broken build

Change-Id: I1a16eacf94003b3c85a9843eed4a3e8f74969286
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactLookupKey.java
e0bbba6a6026b2577e62097ea8f8f7ebe48da8f5 16-Mar-2010 Dmitri Plotnikov <dplotnikov@google.com> Allowing "-" to occur in contact lookup key

Change-Id: I3402f0ec6ae6196615d428395d27f454fe026fd6
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactLookupKey.java
92fcdfb24194e8527ef59c0af0731825ee46fa45 05-Mar-2010 Dmitri Plotnikov <dplotnikov@google.com> Adding a format of contact lookup key that works better for unnamed unsynced contacts.

Bug: 2385103
Change-Id: I79d7e4d62077a5ebc0231c24ffa07ea05ba9c77f
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactLookupKey.java
e2a3fb8c60d68aaef5f20587e5c9cb3f6f3ffa22 06-Oct-2009 Megha Joshi <mjoshi@google.com> Fix lookup query throwing exception for null displayNames.

Bug: 2133257
Dr No: TS
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactLookupKey.java
285b771bc955305fa6d49ca23f808cecc8a13d5e 03-Sep-2009 Dmitri Plotnikov <dplotnikov@google.com> [Issue 2092543] Making manually created contacts show in the list immediately.
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactLookupKey.java
cf80ca3101d80a431809c3bec834bc329416ae99 31-Aug-2009 Dmitri Plotnikov <dplotnikov@google.com> Fixing NPE that occurs in contact lookup key when both name and source ID are null.
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactLookupKey.java
5870f2dcc2ac7715b2c078a886ee346622e7887e 31-Aug-2009 Dmitri Plotnikov <dplotnikov@google.com> Adding soft identity to Contacts
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactLookupKey.java