History log of /packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
2ee1d54fa1e22b2c88897c1a60e7f642a81f9562 29-Aug-2016 Makoto Onuki <omakoto@google.com> Fix multi-locale issues

- Don't ignore LOCALE_CHANGED sent when CP2 is already updating
locales.

- Don't add multiple Chinese locales.

- Don't add any Chinese locales after Japanese.

- Also fix the flakiness in the test.

Bug 31115382

Change-Id: Ib17d08f7947cb02aa7052d8ed6b67690361c47bf
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
a49f8a4df4a805a7ac0034e587e1d1ebcc87e685 11-May-2016 Tingting Wang <tingtingw@google.com> Use CONTACT_METADATA_SYNC_ENABLED.

BUG 28295805

Change-Id: I115d95c47a5b5f48d9b34dcf09ea9028a870b073
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
a9d2c06a03a653954629ff10070ebbe4ea87d526 06-May-2016 Tony Mak <tonymak@google.com> Fix enterprise contacts APIs naming and docs

Bug: 28295752
Change-Id: I36c4328766d8edf0b3f6c5644443794c3a824c3b
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
13c52d12c2af39d7782e5fd75702d5a42b594b6f 29-Apr-2016 Ricky Wai <rickywai@google.com> Move cp2.scanPackagesByUid() to worker thread

So now cp2.scanPackagesByUid() and scanAllPackages will not
run in parallel.

Bug: 28334569
Change-Id: Ie36feb54b13ae80b9cceb4c6dc69365c67db345d
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
4d089e6ae79b011abbd6495b5181674d91561188 15-Mar-2016 Makoto Onuki <omakoto@google.com> Fix flakey vcard test

When the test fails, I see an error from MemoryFile, which is used
in ParcelFileDescriptor.fromData(). However the thing is this
method is deprecated -- so I rewrote it to use a pipe instead.

Bug 27335482

Change-Id: Ib75d9e93ac2610d3145889fe269abeec3d7c3dee
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
8609f2b0aa1de993bd8f5e0f65eee8f8d46d6664 23-Feb-2016 Tingting Wang <tingtingw@google.com> Notify focus sync adapter for contact metadata change.

Notify focus sync adapter and also mark its raw contact as dirty
if there is contact metadata change.
For metadata change, starred,pinned,send_to_voicemail,data usage,
aggregation is covered in this cl. For data primary info, it has
been processed in the old logic.

BUG 27301947

Change-Id: I5ffda518f345a6174b38cfacf7df7cf294cfaa04
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
e3443220edd7afdba6e5c4259232ad2b253fa1c8 22-Feb-2016 Tingting Wang <tingtingw@google.com> Notify change for rawContact metadata change.

Also apply change to Contacts table if there is change in RawContacts
send_to_voicemail.

BUG 27295917
BUG 27296055

Change-Id: I2d85ea18ad1d341bcd2f576b21b405826265677c
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
b716ac69042174eb9b5a00d132a27e32b5693caa 17-Feb-2016 Tony Mak <tonymak@google.com> [CP2] Add new API PhoneLookup.CONTACT_ID

It is a mistake that we put contact id in PhoneLookup._ID.
But for SIP query, the contact id is put in Data.CONTACT_ID instead.
For backward-compability issue, we can't revert the change, but to
save developer from having logic like below, PhoneLookup.CONTACT_ID is
introduced.

if (sip) {
get contact id in Data.CONTACT_ID column
} else {
get contact id in PhoneLookup._ID column
}

So for sip query, we put contact id in PhoneLookup.CONTACT_ID.
For other phone lookup query, we put contact id in both PhoneLookup.ID
and PhoneLookup.CONTACT_ID.

BUG:27149017

Change-Id: I4155da29bbacdda0d43164b0ce11c7224a4eee67
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
b44b5e621015cf5bf68cc2eec8ca6102af8739b3 10-Feb-2016 Tingting Wang <tingtingw@google.com> Fix wrong param when notifyChange to metadata sync.

BUG 27123286

Change-Id: I34e51619455f9d1cf5660a9ec21b8a734ed737c1
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
d2f3ed91e988e487ab4213c5c27659097d490c18 10-Feb-2016 Ricky Wai <rickywai@google.com> Fix failed enterprise unit tests in CP2

Changes:
- queryCorpContactsProvider will throw exception if
it receives non-cp2 query
- Resolved the conflicts between ag/861964 and ag/861953
so test cases will check empty cursor not null cursor
- Remove getCorpUserHandle(c) in tests as no code using it.
(Proguard will stripped out unused method in CP2 and cause test fails)

Bug: 27114665
Change-Id: I33e87ada0bc1b62174c9a0d9df8840ba3fa23a3c
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
fc59cc45836bc9c07afc9b44a622488106b706e6 08-Feb-2016 Tony Mak <tonymak@google.com> Clean up enterprise uri related code in CP2

1. Replace all (projection != null) ? projection : xxxDefault code
with createEmptyCursor

2. Merge CONTACTS_FILTER_ENTERPRISE uri handling code into
queryFilterEnterprise.

3. Remove function rewriteQueryParameters as it is only used in
CONTACTS_FILTER_ENTERPRISE code.

4. Merge queryPhoneLookupEnterprise and queryEmailsLookupEnterprise

5. Pull out function convertToLocalUri and add tests for it.

Bug:26978948
Bug:27061543

Change-Id: I2ed8eb88fdc53783622566dd37f79763014dca03
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
6438a1b52b1e0fac58ddbb54b6a364c32c57f00b 04-Feb-2016 Ricky Wai <rickywai@google.com> Centralize EnterprisePolicyGuard checking code in CP2.

Also modifed enterprise policy guard checking code checking from primary CP2 to work CP2,
So all cross profile queries to CP2 will be checked in CP2's query().

Bug: 26558513

Change-Id: Ib1e212817c4fe398551c581e8b5b92c6cf510a55
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
5a9557efdbd30b9e3ea7bffea428cfa36de2518b 28-Jan-2016 Makoto Onuki <omakoto@google.com> Merge "Use LocaleList to support multi-locale to improve name "bucketing"."
2a237a4ade82ac8b3c3b9d6ce36cfb0fe6afe702 25-Jan-2016 Makoto Onuki <omakoto@google.com> Use LocaleList to support multi-locale to improve name "bucketing".

We used to keep the previous locale on the locale change event
and used it as the secondary locale, but now that the framework
officially supports "LocaleList", we switch to the new mechanism.

On the contacts app, this affects the name "buckets". Adding more
locales means you may get more buckets for the letters specific to
these locales.

- Now ContactLocaleUtilsTest doesn't check supported collators.
Turned out quite a few collators were considered missing (because now
they're tied to languages, not language-country pares?) and were
simply skipped. In the meantime, apparently the labels for some
languages have changed.

Bug 26142164

Change-Id: I4ff7e7d51d000adb6b996eb77da07af5cd44849f
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
64ef027f6b8e4c78193969076a7d03f58d3d7db2 26-Jan-2016 Ricky Wai <rickywai@google.com> Handle null corp cursor result correctly

Bug: 26560753
Change-Id: I204602028b65f9f34ff8cc8db1ce958a6912fcaf
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
7d8c2d4c22024478a36cc57b9288ca5e7b3fb7e6 22-Jan-2016 Victor Chang <vichang@google.com> Merge "Fix long lines (>100) in ContactsProvider"
f3dc1eddc0bc9f25f450465b5565aad7d84174a9 22-Jan-2016 Victor Chang <vichang@google.com> Fix long lines (>100) in ContactsProvider

Change-Id: I2d0f3a68863a390b98f64449a8338269c347c58a
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
cd2141bede514a5e222ef5a48f017c96395eb0d2 20-Jan-2016 Ricky Wai <rickywai@google.com> Make sure CP2 enterprise queries work when FBE is enabled

Bug: 26679081
Change-Id: Ib58c609d490f72f92dc680c3c8c71ccf3c06219f
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
43d1d1a6e5d41aa2bce851ab89ddaa91036d2559 19-Jan-2016 Makoto Onuki <omakoto@google.com> Merge "Re-scan all directories only after OTAs."
09a3f70ebd97c739d01393f4b3748b0eaf548f02 16-Jan-2016 Makoto Onuki <omakoto@google.com> Re-scan all directories only after OTAs.

Currently CP2 scans all directory packages every time it starts,
which is a more or less slow operation.

With this change, we only do it only when after OTAs (when the OS
version changes).

Bug 26062101

Change-Id: Ifa3d6c29dacfa01572dfee31581d607f287390f9
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
6cbbe5bc1c00965f1e9c5648e94d1c82b113ef64 15-Jan-2016 Tony Mak <tonymak@google.com> Add directory support for EMAILS_LOOKUP_ENTERPRISE uri

Bug=26561677

Change-Id: I79c5d3dd204772bbe45010634b2dadaf4c8b4fd1
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
1c720c47fdf502f527b05843ec9eca65289d5283 06-Jan-2016 Victor Chang <vichang@google.com> Show photo of enterprise directory contact in personal dialer

Implement the following uri conversion for enterprise directory photo uri
1. Personal CP2: content://com.android.contacts/directory_file_enterprise/content%3A%2F%2Fcom.google.contacts.gal.provider%2F<PATH>?directory=1000000003
2. Corp CP2: content://12@com.android.contacts/directory_file_enterprise/content%3A%2F%2Fcom.google.contacts.gal.provider%2F<PATH>?directory=3
3. GalProvider: content%3A%2F%2Fcom.google.contacts.gal.provider%2F<PATH>

BUG=25981851

Change-Id: I0e0ea19d589d54a39881f5ecc7d0257dde83ddde
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
9be8c68e62112d607d0f31066df8c0b9c9587340 14-Jan-2016 Victor Chang <vichang@google.com> Merge "Create a new device policy for controlling work contacts search"
6040ab71df843cbb9562ded8b819bfff1c0d9838 05-Jan-2016 Victor Chang <vichang@google.com> Create a new device policy for controlling work contacts search

Extra things:
1. fixed b/26399207
2. ContactsActor.java is changed to avoid failed unit test
because of using getSystemService(serviceClass) in EnterprisePolicyGuard
3. Make ContactsProvider2.sUriMatcher and all uri codes public

BUG=25981902, 26399207

Change-Id: I0025b809a39ff31663a15cfbcdfd087a98187c44
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
9dc4a04ae33e707ce6dd7a9af6b921e8b4db69ce 06-Jan-2016 Victor Chang <vichang@google.com> Fixed enterprise caller id photo not displayed in IncallUI

BUG=26420066

Change-Id: Ib135f7e35a699547b548a145f1ad16a89a72fae9
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
9c3e7ad61675bcd13e8895fac60010544be0f6db 06-Jan-2016 Victor Chang <vichang@google.com> Show thumbnail photo in regular search in dialer

This CL fixes that regular search can't display photo

BUG=26082618

Change-Id: Iefd6ccd984e94f13797efd272b9cba15180909ba
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
87a9fc205e3d8a61c5e53d1d281e27728b615e20 23-Dec-2015 Tingting Wang <tingtingw@google.com> Fix bugs on Lychee CP2 part.

1) If backup_id is updated (or created by sync adapter), re-notify
metadata network if there's dirty change before.
2) If backup_id is created by focus sync adapter and there's metadata
in metadata_sync table, merge them for the new backup_id.

BUG 26310045

Change-Id: I8af3e67564bd387b2417ceb6ccc353e51ff57dcd
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
4d65991c43113b45a929ecd838e2dcf4322edefa 26-Nov-2015 Victor Chang <vichang@google.com> Fix phone_lookup_enterprise decodes phonenumber twice

BUG=25900607

Change-Id: Ib68bd7ab04bc9da0a9abcc846e3441326776574a
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
ef2742aca104b82d1de746327b0fbf188eb88ccf 14-Dec-2015 Tyler Gunn <tgunn@google.com> Fix ContactsProvider2 NumberFormatException when parsing directory ID.

This used to be: if (directory != null), so I presume this should still be
!TextUtils.isEmpty() with the new style.

Bug: 26175069
Change-Id: Ie81a157b2cdb78efc1dc839cec10544d9cd68e2b
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
52f827cacd48607b1415272bf5ad949443589296 14-Dec-2015 Victor Chang <vichang@google.com> Merge "Fix trailing slash in ENTERPRISE_CONTENT_FILTER_URI"
9b1dfa16ae2478940beca65b69b445cc6697b250 09-Dec-2015 Ricky Wai <rickywai@google.com> Make enterprise uri can work with regular directory id

Bug: 25998131
Change-Id: I7db75eff1e2fd49ee5fdd5bc0ea5756a140749e8
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
c903289fe6f11b6f8ef3d3a392a7f0d08576edc1 09-Dec-2015 Victor Chang <vichang@google.com> Fix trailing slash in ENTERPRISE_CONTENT_FILTER_URI

BUG=26097781

Change-Id: I5bcebed108eacb89e6529b0d1bd720066731c740
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
96efe76f799d07b496a4601ab0e506c51cff4e99 08-Dec-2015 Tony Mak <tonymak@google.com> Implement Email.ENTERPRISE_CONTENT_FILTER_URI

Bug: 26074697

Change-Id: I433f10887d8261abd7904d14a4b5a7f77b88ac17
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
355f770df05ca4160ab795e8eaefc1dc33519fee 08-Dec-2015 Tingting Wang <tingtingw@google.com> Update directories when initializing ContactsProvider. am: 59af846139
am: 6e8b2e3e5c

* commit '6e8b2e3e5c79013e44631a6f42594049abbba61f':
Update directories when initializing ContactsProvider.
fd0bf6fa8b4e701de5785a53b5981c62ad6fadab 30-Nov-2015 Victor Chang <vichang@google.com> Implement CALLABLES_FILTER_ENTERPRISE and PHONES_FILTER_ENTERPRISE in CP2

BUG=25899500

Change-Id: I8e468b00f51d98360fc4c1cb675d2f98549337d7
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
6e8b2e3e5c79013e44631a6f42594049abbba61f 07-Dec-2015 Tingting Wang <tingtingw@google.com> Update directories when initializing ContactsProvider.
am: 59af846139

* commit '59af846139224607b667c61ee191bf363ef929ba':
Update directories when initializing ContactsProvider.
59af846139224607b667c61ee191bf363ef929ba 05-Dec-2015 Tingting Wang <tingtingw@google.com> Update directories when initializing ContactsProvider.

This is to fix a bug when reading exchange provider. Updating directories
can fix it without factory reset or account changed.

BUG 22398175

Change-Id: I36e05ff5f7bc83dc25ab165e5f5fb122bbe6c160
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
d83fa00b08e7ddfa75b0d9361ab1dcb081b17b89 04-Dec-2015 Ricky Wai <rickywai@google.com> Add CONTACTS_FILTER_ENTERPRISE in ContactsProvider

TODO: Fix test cases after feature is completed
Bug: 25839367

Change-Id: If2f9a24f1edb6d27ab4421361e273b81e0cfc205
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
7e854d0735da44c6610e489a5a67e793f2719027 09-Nov-2015 Ricky Wai <rickywai@google.com> Add Work Directory APIs in Contacts Provider

Also let Enterprise PhoneLookup API can query local or corp directory.

Bug: 25786494
Change-Id: I6a0acb83481c84aa1df5be94541778fb3e1bf261
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
538413376d6608f1765e0913be72ff9c5c3c9891 25-Nov-2015 Makoto Onuki <omakoto@google.com> Show per-app CP2 usage in bugreport

Note we don't persist the numbers, so they're number since CP2
started.

Bug 24949200

Sample output:
Client activities:
UID Query Insert Update Delete Batch Insert Update Delete:
10010 2 0 0 0 0 0 0 0
10011 26 0 0 0 0 0 0 0
10048 185 3 3 0 9 1013 150 1
10057 37 0 0 0 0 0 0 0

Change-Id: Ia68ea8090cc569fb4483560944db126964875458
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
f45c0a2612c7cdf6ee29242e65a30476537cc699 24-Nov-2015 Makoto Onuki <omakoto@google.com> Show basic contacts stats in bugreport.

Bug 24949200

Example output:

PROVIDER ContentProviderRecord{5b986d5 u0 com.android.providers.contacts/.ContactsProvider2} pid=18434
Client:

Contact aggregator type: class com.android.providers.contacts.aggregation.ContactAggregator2

FastScrollingIndex stats:
request=0 miss=0 (0%) avg time=0ms

Contacts stats:
Database: Contacts
Accounts:
1 makoto.android.6@gmail.com com.google (null)
2 makoto.android.1@gmail.com com.google (null)
3 makoto.android.1@gmail.com com.google plus

Contacts:
# of visible: 2343
# of invisible: 3103
Max # of raw contacts: 3
Avg # of raw contacts: 1.001933612632936

Raw contacts (per account):
1 total # of raw contacts: 2018, max # per contact: 3, avg # per contact: 1.0009920634920635
2 total # of raw contacts: 1077, max # per contact: 2, avg # per contact: 1.0009293680297398
3 total # of raw contacts: 14, max # per contact: 1, avg # per contact: 1.0

Data (per account):
1 total # of data:15763, max # per raw contact: 15, avg # per raw contact: 7.811199207135778
2 total # of data:6887, max # per raw contact: 20, avg # per raw contact: 6.394614670380687
3 total # of data:95, max # per raw contact: 10, avg # per raw contact: 6.785714285714286

Database: Profile
Accounts:
1 makoto.android.1@gmail.com com.google plus

Contacts:
# of visible: 0
# of invisible: 1
Max # of raw contacts: 1
Avg # of raw contacts: 1.0

Raw contacts (per account):
1 total # of raw contacts: 1, max # per contact: 1, avg # per contact: 1.0

Data (per account):
1 total # of data:6, max # per raw contact: 6, avg # per raw contact: 6.0

Change-Id: Iae9f1f904b623a4f64684da99b825b2cb1127758
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
7e04f2e7d77080bad5678c9c908ca91bb8c1a765 18-Sep-2015 Tingting Wang <tingtingw@google.com> Modify CP2 part to support new People backend API.

Aggregation type is changed to "AUTOMATIC" from "UNSET" in People
API proto. Change it in CP2 to support the new string.

BUG 24168448

Change-Id: I15d0fe612aab96fa565f91ecc9afa4a4db86a0b4
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
7087614bab5bb6bdd37293b2477c1bc9745f3a73 26-Aug-2015 Tingting Wang <tingtingw@google.com> Delete aggregation exceptions that are in CP2 not server.

When syncing down metadata from server to CP2 local tables,
if aggregation exceptions are in local but not in server side,
delete them from CP2.

BUG 23557858

Change-Id: Idc65ab9f8e2f04f60b0fbdc71b6a8e825aa09ff9
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
95f9dd1f662efbc546bc1d126200235cf3a428a8 21-Aug-2015 Zheng Fu <zhengfu@google.com> Notify metadata change if a new raw contact is inserted by sync adapter.

Bug:23287952
Change-Id: I3a3b1f1e73aaf655c0d30a494473b1bebf71b3f3
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
1757d8a3026ed77f213621c4adeee718049ac712 19-Aug-2015 Jay Shrauner <shrauner@google.com> am f3eb0748: Merge "Fix lookupkey encoding/decoding"

* commit 'f3eb0748aae1c42f5de2c4f848ef6196e6d297ae':
Fix lookupkey encoding/decoding
54852a92900a2031e00993ffde2376d6afb75873 19-Aug-2015 Tingting Wang <tingtingw@google.com> Merge "Update metadata tables when removing an account."
63ab7eb15ab99510ab3cd77e761dbca60662e787 18-Aug-2015 Tingting Wang <tingtingw@google.com> Update metadata tables when removing an account.

Delete rows from metadata_sync and metadata_sync_state tables
when removing an account from CP2.

BUG 23287168

Change-Id: I091995f77db6d44dc9793d8cb6cb4c6011a0f2ce
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
5192ea69f0598d7f3a9954babdcd6825695c34c0 13-Aug-2015 Jay Shrauner <shrauner@google.com> Fix lookupkey encoding/decoding

Change ContactLookupKey.parse() to no longer decode the lookup key
and update the CP2 callers that were calling lookupContactIdByLookupKey
with encoded lookup keys to match the callers that were not.

Bug:23183735
Change-Id: I3803150a5ce83c2b40b042b5d0a6b7bfd45cfe5d
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
6d6b2a5cd3d639bb0f878334b46720845ef92aa6 13-Aug-2015 Jay Shrauner <shrauner@google.com> Fix lookupkey encoding/decoding

Change ContactLookupKey.parse() to no longer decode the lookup key
and update the CP2 callers that were calling lookupContactIdByLookupKey
with encoded lookup keys to match the callers that were not.

Bug:23183735
Change-Id: I3803150a5ce83c2b40b042b5d0a6b7bfd45cfe5d
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
439e5f4848386eb775c512c23ab892115150d007 13-Aug-2015 Jay Shrauner <shrauner@google.com> Fix broken unit tests

Read/write social streams permissions were removed.

Bug:
Change-Id: I044f18e602d860e334005182d37fbc5734780707
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
c635ef107047450f4dd5b633ffa5ccd085a83014 28-Jul-2015 Zheng Fu <zhengfu@google.com> am cbae3b0b: am fb4b2705: am 5a47ebdd: am ed6a10c2: am b049fb09: Default contact aggregator to ContactAggregator2.

* commit 'cbae3b0bb4b0889825ee1fafa3bf86fb16f33077':
Default contact aggregator to ContactAggregator2.
b049fb09ba37aafc5c12dd93ebf15d219e6dc726 28-Jul-2015 Zheng Fu <zhengfu@google.com> Default contact aggregator to ContactAggregator2.

New aggregator has been tested via gservice flag.
Now we make it default regardless of the gservice flag.

Bug:22355413
Change-Id: Iff9464dfc7bdd6342eafecc22e052786edd37acd
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
9cdb133fc4bfad7e56230fed11d083f12b5cf805 18-Jul-2015 Zheng Fu <zhengfu@google.com> am 6222aefa: am a266119d: am 72445532: am 0dc8027b: am f3d2981b: Should update aggregate data after marking raw contact deleted.

* commit '6222aefa60179ecc82be084703968496e0e1a233':
Should update aggregate data after marking raw contact deleted.
f3d2981b53b7d4715da1d35f5425b19766a92f8b 17-Jul-2015 Zheng Fu <zhengfu@google.com> Should update aggregate data after marking raw contact deleted.

Bug:22564056
Change-Id: Ic9ea29ee9fd72ff12a977565fba4f4e9be285b23
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
8c40af8bee303998d7f7416d6de56a390b5bc04a 16-Jul-2015 Chenjie Luo <cjluo@google.com> am 1fd58d17: am bcf0492b: am 7e89ca37: am 8389c727: am 37a30e36: Merge "Remove extra logging with privacy info" into mnc-dev

* commit '1fd58d171fd87b9b9e932872a37673c367227547':
Remove extra logging with privacy info
39867c22b1335d866d21a2c5c3b3e5123045d550 15-Jul-2015 Chenjie Luo <cjluo@google.com> Remove extra logging with privacy info

Bug: 22075764, 22379601
Change-Id: I05a27684641083fa3ce172d4ffa6b5ff0718af19
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
e91d40981dc987fd5a0b4c4f0b89791f69bea7d7 14-Jul-2015 Zheng Fu <zhengfu@google.com> am 8697c675: am c4de8153: am ee3253ca: am 43f9a00c: am cc9ce6b1: Dealing with some edge cases with soft deleted contacts. 1. Exlude soft deleted contacts for aggregator algorithm upgrade. 2. Make sure to update the contacts.name_raw_contact_id column for soft deleted

* commit '8697c675d86672d5f491042c0aeb7ae4ab3476ee':
Dealing with some edge cases with soft deleted contacts. 1. Exlude soft deleted contacts for aggregator algorithm upgrade. 2. Make sure to update the contacts.name_raw_contact_id column for soft deleted raw contact.
cc9ce6b1c8f9d7c4d8b4da96003ce74ccaa636cc 11-Jul-2015 Zheng Fu <zhengfu@google.com> Dealing with some edge cases with soft deleted contacts.
1. Exlude soft deleted contacts for aggregator algorithm upgrade.
2. Make sure to update the contacts.name_raw_contact_id column for
soft deleted raw contact.

Bug:22378846
Change-Id: I53a48ced645f9b00b708b4b9d88518a529834f89
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
951b633b3f2c66be92d335098fcf85a84dcaa6cd 03-Jul-2015 Sudheer Shanka <sudheersai@google.com> am 1b5690a8: am 8a7c1d87: am 1d48d5a9: Copy ringtone uri when rewriting cursor from corp profile.

* commit '1b5690a8fa44093450174e746c33a23ff03c8c31':
Copy ringtone uri when rewriting cursor from corp profile.
1d48d5a992c32d37bc9535686d96569680639cfa 30-Jun-2015 Sudheer Shanka <sudheersai@google.com> Copy ringtone uri when rewriting cursor from corp profile.

This will make it possible to change ringtone of a contact
in the corp profile to any internal system sound. But if it
is set to a custom sound, then it will be ignored.

Bug: 21754741
Change-Id: I7f510dd3a8ddce4587f3728cbe36ef5a1f386bdc
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
bab7b86e9405118149a171d64e56778fafe012da 23-Jun-2015 Svet Ganov <svetoslavganov@google.com> am 8e0f8c35: am 0371d431: am c8ceb951: Merge "Remove read/write social stream permissions" into mnc-dev

* commit '8e0f8c35d503821c8974ff5a9a5e2829ba5aff2a':
Remove read/write social stream permissions
43e057c1ae9201eabbcc05a330e85b66d0b16576 23-Jun-2015 Svet Ganov <svetoslavganov@google.com> Remove read/write social stream permissions

Change-Id: Ic51857dd196494168aebb66148a4dfe0533c6924
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
2b1a104a4b743011ea13338d072b6e03efdab0c6 17-Jun-2015 Makoto Onuki <omakoto@google.com> am 36553f1a: am 1efb4c21: am 3edc78c7: Guard against directory provider crash

* commit '36553f1adb17b97e4a6a8825394aa8b9a8731439':
Guard against directory provider crash
3edc78c78ba277b116c28fde9b8759cb18f03e1e 16-Jun-2015 Makoto Onuki <omakoto@google.com> Guard against directory provider crash

Bug 21724632

Change-Id: I69765a4a4a416aeaa4563520526811ae019392a1
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
3ad4f2e72b677e3f7936af17f831bf6cdd95aa69 11-Jun-2015 Zheng Fu <zhengfu@google.com> Merge "Revert metadata_sync table and related code from M" into mnc-dev
712533da14e5541b20097c8609905db1d52d0f10 10-Jun-2015 Zheng Fu <zhengfu@google.com> Revert metadata_sync table and related code from M

Bug:20553119
Change-Id: I89b48cc5a39a57ebeafe7821f07c410dac871258
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
cb046a65f9e370c28a8535ee0c123ac0aeb2a3b3 09-Jun-2015 Zheng Fu <zhengfu@google.com> am 411cfcd3: am cf6adcbb: am 039259f7: Merge "Roll out new aggregator to limited dogfooders." into mnc-dev

* commit '411cfcd30431fae1a297b29bb8a45eb97045c65f':
Roll out new aggregator to limited dogfooders.
039259f7a3fa9cb11e891c878728b6cc0bc80f25 09-Jun-2015 Zheng Fu <zhengfu@google.com> Merge "Roll out new aggregator to limited dogfooders." into mnc-dev
a87f9f49c7f773d9ad0926de5017463d72938dab 09-Jun-2015 Zheng Fu <zhengfu@google.com> Roll out new aggregator to limited dogfooders.

Bug:19908937
Change-Id: I77e09aac3c60c60882f508a637225a4dc478a2ce
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
18fa97da7c17ce342c492f22fcff064c05a52783 09-Jun-2015 Makoto Onuki <omakoto@google.com> Actually make CARRIER_PRESENCE accessible (for master)

Bug 20257870

Change-Id: If3996fe3ae1504897565111053848ceeb9a80c44
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
1440fb9d8e4edefb57336532734f7cbab13a955f 08-Jun-2015 Makoto Onuki <omakoto@google.com> Actually make CARRIER_PRESENCE accessible

Bug 20257870

Change-Id: I5e7e12372dde1aeffaea1e953c16d86e341c3b66
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
da88907f67135cfb61fd71a428b1fe0dc074860e 04-Jun-2015 Makoto Onuki <omakoto@google.com> am 24f658da: am de177d72: am cabd7cf8: Fix NPE in enterprise API & fix unit tests.

* commit '24f658da4b726adeaa803e4f4c36934e485811cb':
Fix NPE in enterprise API & fix unit tests.
cabd7cf832f5b160c30bff9c7b975bbf21a95d8e 04-Jun-2015 Makoto Onuki <omakoto@google.com> Fix NPE in enterprise API & fix unit tests.

Bug 21632829
Bug 21634841

Change-Id: Ic18f44e8de31fe48b1d3b7f3a49c355a4865aeca
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
a01b940125f91a96a2aa7b9711a9cd8f9ff4abbf 02-Jun-2015 Brian Attwell <brianattwell@google.com> am c1d81cd3: am 094a424d: am 95f4fd8b: Decouple ProviderStatus & internal provider state

* commit 'c1d81cd3a64eef9dcdf4de60dc903670152e7909':
Decouple ProviderStatus & internal provider state
95f4fd8bf381ed9319f139febc369ce70dcb022e 29-May-2015 Brian Attwell <brianattwell@google.com> Decouple ProviderStatus & internal provider state

Bug: 21090207
Change-Id: I7e93e36ad0c0d667ac56983c76acb1b97bd8755c
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
f179c27ea68de60b970f34d7626846a02047a0ff 01-Jun-2015 Ricky Wai <rickywai@google.com> am 77321a67: am 887e7bb7: am d67c70c5: Merge "Fix enterprise path permission checking" into mnc-dev

* commit '77321a678b20898963b42d9ed6c36570d4a46e68':
Fix enterprise path permission checking
22f452cd02b95c601b8d58fcb6524d6cc66278aa 29-May-2015 Ricky Wai <rickywai@google.com> Fix enterprise path permission checking

Bug: 21489358
Change-Id: I5f655d5a41723f067533c2ae5c867dcbe3cc604d
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
494d793abeb524321fc7192ead9e4ea22eb71573 28-May-2015 Brian Attwell <brianattwell@google.com> am c9d68371: am ce51d241: Merge "Stop enforcing {READ,WRITE}_PROFILE permissions" into mnc-dev

* commit 'c9d68371fd908b2bfb447de2487cbebb21f71ba7':
Stop enforcing {READ,WRITE}_PROFILE permissions
ce51d2418ae766feed51f05ea69735753fbacb68 28-May-2015 Brian Attwell <brianattwell@google.com> Merge "Stop enforcing {READ,WRITE}_PROFILE permissions" into mnc-dev
e3afdce8647e144c2d0c81f48860138deb976cdf 28-May-2015 Brian Attwell <brianattwell@google.com> Stop enforcing {READ,WRITE}_PROFILE permissions

I should also remove all support for the Authorization
API from CP2 now that we've decided there is no need
for it. I'll leave cleaning this up for after I've
finished unbundling the Contacts app.

Bug: 21090207
Change-Id: I31e6ae7b0f49c3589071f6a95f8d69a9456c144d
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
2adee1b3012e1a2728fd9701419cc6214dd9fbac 27-May-2015 Makoto Onuki <omakoto@google.com> am 7c7da354: am 3a83f4c6: Fix invalidateAggregationExceptionCache().

* commit '7c7da354765fffe6859781df47fafd18fc2fff4d':
Fix invalidateAggregationExceptionCache().
3a83f4c60fbe7eb2ee31186d0675dcfbac3ee6b5 27-May-2015 Makoto Onuki <omakoto@google.com> Fix invalidateAggregationExceptionCache().

Also clean up aggregator in preparation in preparation for b/19482664

Two tests in ContactAggregator2Test are failing, but it's irrelevant to this
change. (Bug filed for this.)

Change-Id: Id630812335fdaa2ab4955c240700b82fed84d1a8
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
c9ded23a262ba49803b164668d402b95833daf61 26-May-2015 Zheng Fu <zhengfu@google.com> am b3d7e887: am f60c48e2: Merge "Fix bugs in aggregator2." into mnc-dev

* commit 'b3d7e887c5d94f5cdfd86d9f9a12ff76406355a6':
Fix bugs in aggregator2.
891e5b4c377258ff7d7259f2bab6cd6bff202aee 15-May-2015 Zheng Fu <zhengfu@google.com> Fix bugs in aggregator2.

0. Add unit test for aggregator2.
1. Only aggregate raw contacts in the default directory
2. Remove aggregation exception matches from the aggregation suggestion list
3. Fix the sqls to clear primary settings when merging
4. Make the scoring system consistent with current aggregator.
5. Don't aggregate raw contacts without name to any other raw contacts even
when data matching exist.

Bug: 19908937
Change-Id: Ie580def5ee9e3a291cd5bf112ccb29627f9b67cc
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
3dc2352ed3ea1295b1badb97df9e961f3daccde8 15-May-2015 Makoto Onuki <omakoto@google.com> am 6ce17205: am 2d66b50b: Merge "Clean up permissions" into mnc-dev

* commit '6ce17205d1bc6da62b196fd08d5bfd1b0471557a':
Clean up permissions
400e50c1efeb601f6162bd829fdf33e9dc5252f6 13-May-2015 Makoto Onuki <omakoto@google.com> Clean up permissions

- All permission checks now always pass if the caller is self.
- Remove uses-permissions that're enforced by self.

Bug 20927020

Change-Id: I985338495ed947d317f37e1a8d674a40c5e6bfe4
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
b712e3c95a1add30937dee5dddab429ce5247269 08-May-2015 Tingting Wang <tingtingw@google.com> Populate Data.hash_id for Data table.

1) Using a hash method to generate hash_id string generated from
data1 + data2 for non-photo data, or from data15 for photo data.
2) Backfill data.hash_id for Data table if it's null.
3) Update hash_id when inserting a new Data.
4) Update hash_id when updating a new Data with changed data1 and data2
or changed data15.
5) Query data._id using hash_id and raw_contact_id.

BUG 20892843

Change-Id: Ieeab2f4ee6c4644fc1b4b1f57335b74530a7d91d
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
3a423092c2ead2a74f417b0a757d88e5b34a45f4 08-May-2015 Zheng Fu <zhengfu@google.com> Notify contact metadata change on raw contact deletion.

When a raw contact is deleted, mark metadata_sync.deleted as 1,
also notify this change to metadata network.

Bug:20893997
Change-Id: I87579d8451a3276df3b6dc4574f4b64004d07004
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
08fb8384ccb36de3d3d046e287fe5c43c1f85faf 07-May-2015 Zheng Fu <zhengfu@google.com> Notify contact metadata changes to contact metadata authority.

Need to notify metadata changes in the following senario:
1. raw contacts insert/update with column pinned,starred or send_to_voicemail
2. data usage stats update
3. aggregation exception update/insert
4. data delete, or insert/update with is_primary or is_super_primary column

Bug:20893997
Change-Id: I7ca6ae4c1a96baa9bb887ec11869d4194398ae64
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
4309d6d78334fda8a4f16a90fcfb5f3d3e0e53ee 02-May-2015 Tingting Wang <tingtingw@google.com> Process Metadata on RawContact Insert and Delete.

On rawContact insert, read its metadata data column from MetadataSync
table for the new inserted rawContact, and parse it to update related tables.
On rawContact delete, update its metadata as DELETED in MetadataSync table.

BUG 20055460

Change-Id: I785cf7dd260b8ecf110d5724c017b1cdf85661cb
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
384b448938b82c8ebf1628673d0aaee6972a5b69 30-Apr-2015 Zheng Fu <zhengfu@google.com> Add new ContactMatadataProvider.

Bug:20537162
Change-Id: I499efb7c6238957a65c518a1c938533d2fb8ac54
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
11d45334311f1b2ffa4f6697520939e6ce5b239e 29-Apr-2015 Makoto Onuki <omakoto@google.com> Fix SIP enterprise lookup

SIP lookup's _id is the data ID, not the contact ID unlike the non-SIP lookup.
Properly use the contact ID for photo URLs.

Bug 20522260
Bug 20518934

Change-Id: I52535968363c56af3b371197287743eb6e517731
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
57e16b057e5d1fbb2383ddbe7700f2e6c9bc0a33 23-Apr-2015 Tony Mak <tonymak@google.com> Merge "Add unit test for query against Phone.ENTERPRISE_CONTENT_URI"
e56d27b7774a9ce478372069a30f089e46ce855c 21-Apr-2015 Tony Mak <tonymak@google.com> Add unit test for query against Phone.ENTERPRISE_CONTENT_URI

Bug: 19551175

Change-Id: I69bdb672e64474a8daf12c3c38ea5fe262684aab
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
9019dfd748d0a5e39cc041269d8d42e8ee8eb3ef 18-Apr-2015 Tingting Wang <tingtingw@google.com> Merge "Update related tables from MetadataSync.data column."
794ef4db9d70441393b756ce6c4cc456b9143b11 15-Apr-2015 Tingting Wang <tingtingw@google.com> Update related tables from MetadataSync.data column.

MetadataSync.data column info is parsed to MetadataEntry object.
RawContact, Data, DataUsageStats, AggregationException tables need to
be updated or inserted for the given rawContactId from MetadataEntry.

BUG 20055193

Change-Id: I5bdfe2c44f9c9af8d4067dc136ceb62ab0b274af
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
0e464bef9238f150a1a6d97200b49aae9dd33207 16-Apr-2015 Zheng Fu <zhengfu@google.com> Show which aggregator is used in bugreport.

Bug:20298625
Change-Id: I65b20cdbf6567eec2ccd7242359bf1d43b0bfe84
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
aa18c233fdec3359c5231d4a5f61188446bf5d6f 16-Apr-2015 Zheng Fu <zhengfu@google.com> use new setting flag to switch between current and new aggregator.

In order for the switch, add AbstractContactAggregator for
ContactAggregator and ContactAggregator2.

Bug:20055573
Change-Id: I6f27d4df8017938b226f5c6371b15ba41fd18acd
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
94d605997c8cf36c5446bbc6379c7e397297d07e 14-Apr-2015 Ricky Wai <rickywai@google.com> Merge "Remove caller-id check in enterprise phone and raw contacts entities"
42d5b79db882739368b163f4d5f61546d134cdbb 27-Mar-2015 Ricky Wai <rickywai@google.com> Remove caller-id check in enterprise phone and raw contacts entities

Bug: 19990833

Change-Id: Ibba3a0594262b975b3b4fdd4ebd1fcf1e40ff98a
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
1076c4946c230612c8eb56dbcdf2e3ca22a624e3 19-Mar-2015 Makoto Onuki <omakoto@google.com> Enterprise quick contact 2/2

Now openQuickContact goes thorough DPM. When a lookup URI is build with
a lookup key returned by the enterprise lookup APIs for a corp contact, the
lookup key will have a special prefix. DPM checks it and launches QC on
the work profile, if the policy allows it.

Design doc: go/cp2-mnc-enterprise-dd

Bug 19546108

Change-Id: Iccba8254269180281af0154f4b9c20cbfff5c27d
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
5f20fb34e4d6ce4e00aece1a109685e5a0e78a8a 30-Mar-2015 Makoto Onuki <omakoto@google.com> Revert "Enterprise quick contact 2/2"

This reverts commit 9d5369ac6c1d788384d52b11da10f60571238405.

Change-Id: Ib442e2ac351146ad2d5129e39a999478b8ffe547
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
9d5369ac6c1d788384d52b11da10f60571238405 19-Mar-2015 Makoto Onuki <omakoto@google.com> Enterprise quick contact 2/2

Now openQuickContact goes thorough DPM. When a lookup URI is build with
a lookup key returned by the enterprise lookup APIs for a corp contact, the
lookup key will have a special prefix. DPM checks it and launches QC on
the work profile, if the policy allows it.

Design doc: go/cp2-mnc-enterprise-dd

Bug 19546108

Change-Id: I30ffcc1f6f394144182f2cb2b6032568ea5b33eb
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
b593bf1894afe6f57dc9c0dde8bb9d7ac416fa7a 09-Mar-2015 Ricky Wai <rickywai@google.com> Add Email.ENTERPRISE_CONTENT_LOOKUP_URI

Like PhoneLookup.ENTERPRISE_CONTENT_FILTER_URI
Apps in primary profile can have email lookup in managed profile

Bug: 19550046

Change-Id: I492909126faf4e1a2eb5c72f7f76f3a7a0656e6a
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
3638597dbb90113a326bb5e9b0d3af47d1fd8d4c 19-Mar-2015 Ricky Wai <rickywai@google.com> Merge "Add RawContactsEntity.CORP_CONTENT_URI"
30ec266bb7d0648c05606acc60a5be20a7a87686 07-Mar-2015 Ricky Wai <rickywai@google.com> Add RawContactsEntity.CORP_CONTENT_URI

Bug: 19551325
Change-Id: Ie0c31c951edab91b70b7587ab27b68db4e1f6fcd
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
3a9b227565f9cf1eccb736b764d34dba6f20bdac 17-Mar-2015 Tingting <tingtingw@google.com> Make contacts backup schema change accessible.

raw_contacts.backup_id and data.hash_id have been added to schema.
To make them accessible, they need to be added to projection map.

BUG 19667203

Change-Id: I7d122843668d7ed31fc998a2c7f00dc909181fc8
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
b88a02f9551b991a8bc767867ae9ec1ccac75950 19-Feb-2015 Ricky Wai <rickywai@google.com> Add private API to get merged primary and enterprise contacts

Bug: 19550047
Change-Id: I5f2a5e5d54af50cd0b41dd3105e10a4676d17388
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
2eb09524fc4b4afd061d30898dba30fab583545a 27-Feb-2015 Makoto Onuki <omakoto@google.com> Enterprise phone lookup should return consistent result...

regardless of requested projections.

In order to rewrite the cursor returned from the corp CP2, certain columns
are needed to compute other columns.
(e.g. PHOTO_URI requires _ID and PHOTO_FILE_ID).

This CL fixes that by always requesting all columns to the corp CP2.
Now rewriteCorpPhoneLookup() shrinks down the projection.

Bug 19545750

Change-Id: Id817d069554ebc89759303760effb557b152d58a
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
148374fdbe3d723c7485e149afcfed314b2814e0 19-Feb-2015 Brian Attwell <brianattwell@google.com> Persist pre-authorized URIs

When exposing the Authority API, reviewers requested the
API be implemented properly instead of storing the pre-authorized
values in memory.

Bug: 18777272
Change-Id: I31e719b10803344f579bb89c8269f0a597a83c3c
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
f256a7cf7f78d5ff2573358eb2eadd6f3a2ec9db 28-Jan-2015 Brian Attwell <brianattwell@google.com> Remove NAME_VERIFIED. Part3

Support use of IS_SUPER_PRIMARY instead of NAME_VERIFIED.
The contact aggregator now pays attention to
IS_SUPER_PRIMARY.

Remove all references to NAME_VERIFIED from CP2.

Bug: 18777272
Change-Id: I1579a3122b2d45b80de7106a2b9616e323855045
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
e05d1118d89cdbfc9bc0558d04af3ca3b2c6a508 08-Jan-2015 Brian Attwell <brianattwell@google.com> Ubundle from contacts contract Part 2/3

Remove ProviderStatus.DATA1

Discussion: go/contacts-contact-intent-ui

Bug: 18777272
Change-Id: I9c6125cc30710e4637b38f3785608abb9928d1a2
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
098215569d35a130c883933ec76773e85356387e 21-Oct-2014 Zheng Fu <zhengfu@google.com> Modify the contact split logic to avoid over-split issue.

Details

If the best matching contact doesn't contain any raw contacts from the same
account as the given raw contact, join them together if no identity mismatch
between them on the same namespace, otherwise, keep them separate.

If the best matching contact contains raw contacts from the same account as
the given raw contact, join them together if they share at least one email
address, phone number, or identity; otherwise, re-aggregate raw contact and all
the raw contacts of best matching contact.

When re-aggregation is needed, re-aggregate all the raw contacts (given raw
contacts plus all the raw contacts of the best matching contact) based on the
pair-wise connectivity. Two raw contacts are considered connected if they share
at least one email address, phone number or identity.

Bug:18304324
Change-Id: Ic5a27a23c2f64f534f7a7eaf5f3fb474e877c207
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
1c6905d2f799d81d5cb847c44fca7dc7d36fd684 05-Sep-2014 Yorke Lee <yorkelee@google.com> Follow ContactsContract API changes

Bug: 17390425
Change-Id: Ia88fb0235a56becc3ec5a770067856311769a68c
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
ec9680853b8526568a96805e38af77f3c6da175a 26-Aug-2014 Makoto Onuki <omakoto@google.com> Address API review comments:

- Rename isCorpContactId() to isEnterpriseContactId().

Bug 17253963

Change-Id: Ib89b491c52f2b1326a11c991574a117f75fc8bcd
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
89c3c5706ca0b4b061b3f3a1a7ee27d9c0e43d60 16-Aug-2014 Yorke Lee <yorkelee@google.com> Add a maximum length check when inserting or updating phone numbers

Bug: 14307606
Change-Id: Id17a122cb9e86f9ae64232773869cb2108754ed0
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
fe1156f671fadb4dc2302634793f5fbf18423ce7 09-Aug-2014 Yorke Lee <yorkelee@google.com> Add authority for ProfileProvider to fix CP2 NPE at startup

Bug: 16901202
Change-Id: Id47e979a8509fd5b9436970e5150e320390c7bd5
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
9701936fadaf55ef773dd07015b35f99fd5f8a91 07-Aug-2014 Makoto Onuki <omakoto@google.com> Add unit tests for enterprise caller-id

Also fix a few issues:
- Fix projection map for phone_lookup/enterprise and add PHOTO_FILE_ID
- Null out custom ringtones from the corp CP2. Returning rintones in the corp
profile really doesn't make sense.
- Fix a log in queryPhoneLookupEnterprise().

Change-Id: If0617225228c526d4b7d87e9c95f6fbe090242a0
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
ad847316fe64c958b65bc05eb736e704bc56b23f 07-Aug-2014 Makoto Onuki <omakoto@google.com> Fix "UNIQUE constraint failed: mimetypes.mimetype"

With the old code there was a chance of two threads trying to write the same
mimetype simultaneously, ending up getting "UNIQUE constraint failed".

One possible way to fix it is just to add locks, but doing so *might* cause
deadlocks due to implicit locks in SQLiteDatabase. So in this CL, we just retry
when we detect a conflict.

Unfortunately we can't use a transaction here because this method is called
from onCommitTransaction() too.

Also refactored the code to unify getPackageId() and getMimeTypeId().

Bug 16574964

Change-Id: I66274dfd080ae808795a4d59d30978b1ca1c06c0
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
334bb1c93b85b0b3e3feb7d7e1ebd7efabcc1f38 31-Jul-2014 Yorke Lee <yorkelee@google.com> Fix for incorrect PinnedPositions in RawContacts due to legacy pinnedpositions value

Bug: 16403306
Change-Id: I8d23b74b4ecf3e8d9f76bff130720bf7195ef8d0
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
7f4ce37bd099d8dbad3177a2b9ebe341811a5ce2 30-Jul-2014 Yorke Lee <yorkelee@google.com> Follow ContactsContract API change

Bug: 16403306
Change-Id: I21d25ba836d9d9ab45a7ebdca0e2f24f8c678e43
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
3ffe262d93ca0f5669f838c08d5f8384c50eae0f 10-Jul-2014 Makoto Onuki <omakoto@google.com> Enterprise caller-id: Do not null out most fields.

This follows change I21ab20ad4147b303cd0d49d33b64a38275342dc5.

Bug 15779911

Change-Id: I62f0a7a17ec98e6e2fc650defa4843b9e04dbff2
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
5f9dbc1d2645f20ce883c11f6b2511503cecf8ce 09-Jul-2014 Makoto Onuki <omakoto@google.com> Add the enterprise caller-id API

Also Moved UserUtils to utils/

Bug 15779911

Change-Id: Ia4445772f12ebbc0f7832f3700c6fecf2ba13dd2
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
357a8cc44c59c5cf9528789ca949f6f0982e7ec7 09-Jul-2014 Yorke Lee <yorkelee@google.com> Merge "Update CP2 snippeting argument defaults (1/2)"
471923b8d71fb7f9632cad2de4f1583eeda61b62 08-Jul-2014 Yorke Lee <yorkelee@google.com> Update CP2 snippeting argument defaults (1/2)

The Contacts app was the only user of the snippeting functionality in
CP2, so update the default snippeting arguments to those in the Contacts
app.

Also fix some tests that had incorrect assumptions about outdated
functionality.

There is one remaining broken test in CP2 - testSearchByEmail. That has to do
with some special treatment with indexing email addresses and FTS search which
will take some more time to figure out.

Bug: 6948882
Change-Id: Id9af3ceb2dfa43a11ae528e3ab6b42371130a1f7
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
6bcd74c4bc4a14d848a8407562b10a14876082df 08-Jul-2014 Makoto Onuki <omakoto@google.com> Enterprise: Add utility method to retrieve corp user handle.

Also show current user handle in verbose log.

Bug 15779911

Change-Id: If9dac500da44b351232ac8af53dc011be043d010
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
54b97025256764a01f927792e64de8bf369e12f1 01-Jul-2014 Yorke Lee <yorkelee@google.com> Clean up SearchSnippetColumns API (2/3)

Bug: 6948882
Change-Id: I549321e5ecf789f55a67ad4fbf5b939400ff20b8
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
c0552e72e9329571176ae4357eafc07145c492b8 26-Jun-2014 Yorke Lee <yorkelee@google.com> Protect undemote method with permission check

Undemoting goes through a separate code path as the rest of the
CP2 queries/updates, so we need to do a permission check for the
WRITE_CONTACTS permission

Change-Id: I547270376c55f6ff311d5712eef8a6b0b923eee8
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
ea74e9335e384b6abaf1daac9a7a534d5f3d7ff7 25-Jun-2014 Makoto Onuki <omakoto@google.com> Show caller PID in the verbose log.

Change-Id: I1d42a39eb8a27d65b4208dd2174f919929b0fb94
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
ec25418988bb77d1f2482bc2f953cfd361c0f97e 20-Jun-2014 Yorke Lee <yorkelee@google.com> Update PinnedPositions API (1/2)

Follow the framework changes that deleted UPDATE_URI in
ContactsContract.PinnedPositions

Bug: 15593967

Change-Id: Ibf5b0d7fa7588b60742b324ba125075e28d9cc81
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
dcffbdc062336c5403f9f5e1aadbba3f49db335f 18-Jun-2014 Yorke Lee <yorkelee@google.com> PinnedPositions API changes

Add UNDEMOTE_METHOD that is called to undemote a contact
Fix CP2 tests to use batch content provider operations instead of
PinnedPositions.UPDATE_API

Bug: 15593967
Change-Id: Id93c6ac0e214e59107725416b7865c56c9df32f3
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
130dde5aed341af5be72ae7b97ab4485cf4e400e 20-Jun-2014 Paul Soulos <psoulos@google.com> Updates SQL alias in CP2

Change-Id: I73c0b8ee1833feefc60fa7024276222fcfb146c5
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
9214ced257fea11a48d9ed0e2bbfd0da39cb4606 20-Jun-2014 Paul Soulos <psoulos@google.com> Added usage stats to Entity

Change-Id: Idf06de011d1c01ea7dda174189e676177f9c5847
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
d4dbd063cf88e70b045607aa865b2fdb2329bf45 17-Oct-2013 Jay Shrauner <shrauner@google.com> Support secondary locales

Add support for tracking a secondary locale in addition to the current
primary locale for CP2. Switch to using parseable ICU language tag
(eg, "en-US") for locale tag written to DB. Secondary locale is set to
previous locale on locale change and persisted in CP2 DB and prefs.

Bug:8715226
Change-Id: Ia68397fd9118d89f3a45ac54f991f86bad42870e
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
03bc605b5c6f17deae7ad8efbd928abdc5d78854 07-Apr-2014 Ben Gilad <gilad@google.com> Replace the global mValues reference in ContactsProvider2.java
by local instances.

Change-Id: If520599d00dc51dc6e2c99bfedd2baa90e4eb28e
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
a157bdc5a6bc0b4bdf889d0ed6475571bc547012 03-Apr-2014 Ben Gilad <gilad@google.com> One more cleanup CL before the change to remove/replace mValues.

Shouldn't include any functional changes, mostly focused on
dead-code removal, also removing unused/unnecessary code/logic,
tightening up access modifiers (e.g. using private vs. public) as
much as possible, using Java's built-in iteration when applicable,
grouping variables by static/non-static and access modifiers (e.g.
private members last, etc).

Change-Id: I4fa6af136b5da0ae6183eadce4798746b18813cb
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
53ab19d6d135d948620f3a648aeded79a8e7e761 03-Apr-2014 Makoto Onuki <omakoto@google.com> Merge "Partial revert of db1acfece867c4133e1749826f74f5b4e8eed1b2 (http://ag/383391)"
b118e62332952ad5ff4388736de08d0fa75117da 03-Apr-2014 Makoto Onuki <omakoto@google.com> Partial revert of db1acfece867c4133e1749826f74f5b4e8eed1b2
(http://ag/383391)

Do not use constants for initializing the UriMatcher --
it'll make it hard to glance supported URIs.

Bug 13302012

Change-Id: Ic24e535828cff6111bd0649519e24bcc1a9d2a3b
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
ed01879a61a3687dad0bfba133733e4e379331ba 02-Apr-2014 Ben Gilad <gilad@google.com> Remove some dead/unused/boilerplate code.

Change-Id: I8f7a232cd2b2452a46444bb6b8f45df05f8e1e81
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
9273f0155a8dafa61527ef8a71f3e0eaff3e4b8a 05-Mar-2014 Brian Attwell <brianattwell@google.com> Add IN_DEFAULT_DIRECTORY to views and projections

Bug: 13173524
Change-Id: I6c0947d4978e204ce1268f65eab5e1cc66bda664
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
bf98e55afd5f39f72dc05c704409655b89a7fa25 27-Feb-2014 Brian Attwell <brianattwell@google.com> Do not ignore leading "*"s in phone lookups

After a phone lookup, "remove" entries from the cursor that
don't match the queried number w.r.t. to whether it has a leading
"*". "Removing" entries from a cursor involves making a partial
copy of the cursor.

This CL affects as little functionality as possible, so that it
can make it into MR2. Ie, we continue to ignore leading "*"s
in other CP2 queries.

MANUAL TESTS:
-Add a "*123" Emergency contact and "123" Voicemail contact
-Call "*123", then call "123". You should see two seperate
entries in your call log. In addition, the incall screens
should show Emergency and Voicemail respectively (although
the "123" call doesn't work properly inside the incall
UI right now. This is a seperate bug b/13195342).

Bug: 13195334
Change-Id: I7e1938ccb085630072611eb63148c5714b62fee8
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
a51e58d4c7b081bff851e7200a8eae7d946b949e 27-Jan-2014 Yorke Lee <yorkelee@google.com> Respect user-defined selection in STREQUENTS query

The starred portion of the query in the starred+frequents
query does not respect the user's selection. This CL adds
the selection as an AND clause in the query.

Change-Id: Ie36931b0733e3aab05c3d7e2461843e5f3ec7f2d
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
82d88d65f65a0e3eb816cd1ae9d81a0fd78d8a17 10-Jan-2014 Yorke Lee <yorkelee@google.com> Fix EMAIL_FILTER ranking for duplicate emails in different accounts

When there are there are two identical email data items, each belonging
to a different sync adapter account, the "SELECT DISTINCT" operator
causes the two emails to be incorrectly grouped before the account
prioritization sort order is applied.

This can cause the email address to be labelled with the wrong account,
causing it to be incorrectly ranked as an email address from another account.

To fix this, account name and type is added to the group by clause to
ensure that each email address is grouped correctly based on their account
before ranking them by account priority.

Bug: 12207447
Change-Id: Ib79f6c36ee6a83838bcaa82487f2f7fb9716bbf4
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
843ab4932e7bd693c81b769f61e1a56be5b43662 23-Nov-2013 Chiao Cheng <chiaocheng@google.com> Fixes cases when a contact was deleted via the contacts app.

In this case, the contact id of the raw contact is nulled out. This has the
side effect of making the IN clause of sqlite never equal. Similar to:

SELECT 1 as id WHERE id NOT IN (SELECT null);

always returns 0 rows because the comparison to null is always false.

Protect against this case by eliminating null contact ids.

Bug: 11826565
Change-Id: Ide9b150bb7f94d03c210d43dbc8cdd5c42c21cf9
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
db1acfece867c4133e1749826f74f5b4e8eed1b2 01-Nov-2013 Chiao Cheng <chiaocheng@google.com> Use content_uri constants instead of locally defined string.

This makes it easier to trace URI to provider methods and visa versa.

Change-Id: I7961eeba3b88362f1323483ede14865dc7f56948
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
116f57fe659db05186ce85aa192bd65a974684e9 09-Oct-2013 Jay Shrauner <shrauner@google.com> Catch potential NPE

Catch case where country detector might return a null country

Bug:11139097
Change-Id: I5d4841a8f8d852e18cff1f9c359d5e005c7e58b8
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
ec987e500405c067a13b66eeaed1516696790dc4 30-Sep-2013 Mathew Inwood <mathewi@google.com> Revert "Remove global search support."

The global search API is not being deprecated in this release, so we
want to keep the support for it.
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
f6de5a9d1418b0d7f4119d4204818ab3a0fe4fa2 24-Sep-2013 Yorke Lee <yorkelee@google.com> Add IS_SUPER_PRIMARY to default phone only strequents projection

Bug: 10888792
Change-Id: Id9fce5cfc66adfc1192ce752e8a3c2902de2e978
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
e91e4eca5b255bcf46de31deca255d10c8f0b345 24-Sep-2013 Yorke Lee <yorkelee@google.com> Merge "Change CONTACTS_STREQUENTS for phone only queries" into klp-dev
a176ed4c42330e64d0246a10374507c862cec0de 24-Sep-2013 Yorke Lee <yorkelee@google.com> Change CONTACTS_STREQUENTS for phone only queries

This CL tweaks queries for CONTACTS_STREQUENTS to return phone numbers
belonging to starred contacts as well. Before this, the returned cursor
consisted of a mix of starred contacts (without their phone numbers), and
frequently contacted phone numbers.

Change-Id: If0ac847dd26f093d977403ca0100769f6c63be9b
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
258f83d2ce17c5544c514d5b575b9df71b22155c 23-Sep-2013 Yorke Lee <yorkelee@google.com> Merge "Change frequents algorithm to return contacts in a different order" into klp-dev
d820edb03bd5caffc0dff19096552efa817dec59 21-Sep-2013 Yorke Lee <yorkelee@google.com> Change frequents algorithm to return contacts in a different order

Bucketing thresholds
- 3 days
- 7 days
- 14 days
- 30 days
- Any contacts older than this are not shown

Change-Id: I4940920c4eb8ad4f5d130adc0b2acd30a4d7aff6
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
1af2c597003c0fbf181cf0e052ec2830aac87724 20-Sep-2013 Mathew Inwood <mathewi@google.com> Remove global search support.

The global search API is being deprecated. Remove the code from the
contacts provider that implements it, as nothing queries is anymore.

Bug: 10487397
Change-Id: I590e98964e5774dd47340df9b38d252b63a5b915
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
d639ddd61fc7b6f4a7879d583bfd2b595b066265 10-Sep-2013 Yorke Lee <yorkelee@google.com> Fix PHONE_FILTER and CALLABLES_FILTER search behavior

These two filters now only perform name lookups. The search index manager
indexes names, nicknames, and organization title and company name for
name lookups.

Bug: 10680335
Change-Id: I283c61af64a2f104b7482a2819ed4b8a238cba04
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
bb267482ca936e8bf51a020f4f67bf71b0a01f14 20-Aug-2013 Yorke Lee <yorkelee@google.com> Fix bluetooth sharing

Revert https://us3-mirror-googleplex-android-review.googlesource.com/#/c/344550

Change-Id: I03628d48b58d20605206f88a6dbb803b3486f25f
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
40edceb15f39cbcfdcff749433b60b9f01ad47ca 16-Aug-2013 Yorke Lee <yorkelee@google.com> Set UNKNOWN_LENGTH for assetFileDescriptor

This is needed so that ContentResolver.openFileDescriptor doesn't
throw an exception because it can't handle non-unknown file
lengths

Bug: 9864852
Change-Id: I4daeec09bf9f332000eafc3edb1f7ef6046f5048
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
45b023e89d87b66e44c1b79c6e1444ec9db70a82 06-Aug-2013 Yorke Lee <yorkelee@google.com> Handle DEMOTE and UNDEMOTE in CP2

* If a contact is UNDEMOTED, if it was previously DEMOTED, it will
become UNPINNED. Otherwise, it will remain unchanged.

* When two raw contacts are aggregated, the parent contact should
inherit the lower pinned position of the two, not including negative
integers.

Change-Id: I74f41dfa327b8e5a79688b1e99eafbef7d9d58a0
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
a89aa7533a14b143b55bf4a29d284152ab9278a5 01-Aug-2013 Yorke Lee <yorkelee@google.com> Add Data.contact_id to phone strequents projection

This is needed so that operations on frequent contacts
swipe to hide, pin, etc can operate on data.contact_id instead
of data._id.
Change-Id: I66005ebcbf7608b2b96961a5637a6736c1076ab9
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
81fea08280784b319b936a3506788d595c6ce2ad 18-Jul-2013 Yorke Lee <yorkelee@google.com> Add pinning support in ContactsProvider

Change-Id: I3c835c2fd0faf99f8fb176752cfcb12e011095a2
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
8e31d4062aaa2081f9f515a7764e08abfd47c1e5 02-Jul-2013 Jay Shrauner <shrauner@google.com> am 5e0fa885: am 321d81dc: Merge "Change method to determine if the table is empty"

* commit '5e0fa885379a1919f9e7719ba3eb666ee2341084':
Change method to determine if the table is empty
5e0fa885379a1919f9e7719ba3eb666ee2341084 02-Jul-2013 Jay Shrauner <shrauner@google.com> am 321d81dc: Merge "Change method to determine if the table is empty"

* commit '321d81dcc008d4d7b3ad02272960a9972a141c90':
Change method to determine if the table is empty
0e55a38c8a2a94db45b65bbecd78c6d127b721a2 11-Jun-2013 Christine Chen <christinech@google.com> Merge "Add updates on usage data to Delta API."
1708e5af20ea2a109dfba2ab82c69e798e5df2e3 11-Jun-2013 Christine Chen <christinech@google.com> Add updates on usage data to Delta API.

- Updates the last_updated_timestamp of a contact when there is new
usage data available: last time contacted and times contacted.

Change-Id: I633d617681d56072a0d1f09d75a7fcba7e47b219
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
b646ef018cff47aa5583b92b39bdb121b4bf45e5 04-Mar-2013 Hyoseong Kim <muzbit.kim@lge.com> Change method to determine if the table is empty

queryNumEntries API perform "COUNT(*)" query.
It is slower than New API that perform "EXISTS".
If the goal is to determine if the table is empty,
using new API is better.

[+] https://android-review.googlesource.com/52750

Change-Id: Idcc2633d0a5349c59f41e125cf34c9dc6622cdbe
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
e7759bc574ebe2679386068b1b8fd7c17ca3134f 30-May-2013 Jay Shrauner <shrauner@google.com> Use ICU collator for display name ordering

Use ICU collator when ordering by DISPLAY_NAME to get locale aware ordering.

Bug:
Change-Id: I059761a311961a80998a628c67746b78ca3d14c7
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
ee1267f05b98218d26f39875949cbc66a8a9b71d 21-May-2013 Jay Shrauner <shrauner@google.com> Clean up int data conversion calls

Catch various places we would crash if a data column didn't parse
as expected as an int or long.

Bug:9050606
Change-Id: I241e8a2b158eea89a2b86ca20d3b93379668084d
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
1f16c3ea6ef40f6ac5744b59c446c03eb2618e4f 10-May-2013 Jay Shrauner <shrauner@google.com> Fix unit tests when phone is in ja_JP locale

ContactsProvider2 uses method getLocale() to allow tests to override
default locale. This locale, however, was not being used for the
NameSplitter. Change the createNameSplitter method to take locale as an
input parameter so the SearchIndexManager tests will run with the right
search indexes.

Bug:7264326
Change-Id: I2535673032dcd628d8719b00eff6512cba9dc279
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
0c16259ed53295f17e785992d374dcac7d5c9885 25-Apr-2013 Jeff Sharkey <jsharkey@android.com> Close PFD after finished reading from pipe.

Avoids leak.

Change-Id: I2f5197d05e920b85062e5b88abb043a464bf17de
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
da51adb4b99894666e7ea91fed0e8afc94162333 23-Apr-2013 Chiao Cheng <chiaocheng@google.com> Fixed issue where some contacts are not added to delete log.

Contacts with multiple raw contacts were not being inserted into the delete
log when accounts are removed. This was due to the raw contacts being removed
in batch instead of one at a time. The logic to determine whether a contact
can be deleted was determining whether other raw contacts exist. This does
not work when all raw contacts are removed in a single batch.

Added logic to pre-select contacts that will be deleted.

Bug: 8696462
Change-Id: I95adccf9e6756bbf6ca9dd7d144c1d9ee8905631
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
a62622b31107f97be7da9a4b79393e465b64fd36 18-Apr-2013 Chiao Cheng <chiaocheng@google.com> Fixing delta api for account removal case.

Account removal uses a different code path from normal contact deletes. This
patch properly adds deleted contacts into the delete log when an account is
removed. Also updates contact last updated timestamp for the non-delete case
when a raw contact is removed from an aggregate contact.

Bug: 8654272
Change-Id: I05c3ef297e5ad2ca6713e06d0b40206876cf0b9e
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
8ed367fdc0b086d54c489f68d555e2f0a4035f63 12-Mar-2013 Chiao Cheng <chiaocheng@google.com> Adding contacts delta api.

Updates and inserts can be detected through the use of a new timestamp
field in the contacts table.

Deletes can be detected by querying the new deleted_contacts table.

Bug: 8182147
Change-Id: I5c1e596f4e1aa58528afc29396f79cb4051e229c
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
216c434537d05a691add4e22ba3a9d958c976c1e 29-Mar-2013 Yorke Lee <yorkelee@google.com> Provider side changes for exposing data usage stats

Use a uri query parameter to filter for a specific type of data usage,
otherwise the sum of all the data usage stats for that particular
data is returned.

Bug 8124079

Change-Id: Iee4c3accb46c9402f0a1659c9b8943c5a219a169
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
8f8b122c7556350d94c2e349b3093024b0205d8d 08-Mar-2013 Yorke Lee <yorkelee@google.com> Add new apis to CP2

Add Data.Contactables.CONTENT_URI and CONTENT_FILTER_URI
Querying against these uris return email addresses and phone numbers
belonging to all contacts with email/address/names that match the filter
(if provided).
Add VISIBLE_CONTACTS_ONLY boolean parameters to Data

Bug: 8123918

Change-Id: I491cb2ff4c64c9d042d5e21cebc5f90d086c70ac
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
9f675502e2ab04e37b043d29d82b1d19458cd1b2 05-Mar-2013 Jay Shrauner <shrauner@google.com> Merge "Auto-update ContactsDB on ICU version change" into jb-mr2-dev
2d2e22626b698b2484026ae18eca3c2c6340f2d1 27-Feb-2013 Jay Shrauner <shrauner@google.com> Auto-update ContactsDB on ICU version change

Save current ICU version into the ContactsDB and rebuild
locale specific data whenever the version changes.

Bug:
Change-Id: Id5fd3e178558dc903b522b2655c75e6aa353f6e5
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
c6e28121e4c522c31c96e0ea97b66012cc571160 01-Mar-2013 Chiao Cheng <chiaocheng@google.com> Reverting is_primary sort order back to previous priority.

Bug: 8129961
Change-Id: If6dd3b5ebec19ef7c9fea493d90f0e8d88435f01
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
a6a9fa802d1b56c206c670ca1d313bc64effcb5d 14-Feb-2013 Jay Shrauner <shrauner@google.com> Use ICU JNI wrappers for phonebook labels

Switch from using native code registered as sqlite callbacks to using
JNI wrappers for accessing ICU AlphabeticIndex. Stop using specialized
sort keys for Simplified Chinese because ICU code can correctly label
the characters directly.

Bug:
Change-Id: I0568b3a406495c147c7b9b3e72835d11d93f9d16
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
49fb8375e9d3f7385d41b352d164a4e3e98c1528 08-Feb-2013 Dianne Hackborn <hackbod@google.com> Fix issue #8152662: Unable to share a contact via Email

When contacts provider internally recurses into itself, we need
to clear the binder calling identity before doing so, so that it
is consistent with the calling package name we will now be using.

Note that this also means that we won't be doing any further
permission checks against the original caller for these internal
provider calls... which is probably more correct anyway, because
we've already done the permission check on the original incoming
URI and we wouldn't want that to now fail due to some permission
strangeness on another URI it is using internally.

Change-Id: Icc3903287f91f35959a80168a6c107b1803f93a8
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
3c05145763ad30eda83134411968942e1c11d06f 06-Feb-2013 Jay Shrauner <shrauner@google.com> Merge "Fix collation/indexing for i18n contacts"
c9626e7befd591923c6af859ad079abba8a84e41 15-Jan-2013 Dianne Hackborn <hackbod@google.com> Start tracking content provider app ops.

Change-Id: I899c3ae507a0e4feb95c8142b09b92e1fd87eefe
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
fda4395adc9266d0f8e0be8637d0effa7fd1e057 09-Jan-2013 Yorke Lee <yorkelee@google.com> Standardize search algorithm between People and Dialer

Bug: 5930716
Change-Id: Ic7cfffae5de878be683d27f92ccb5b034dc217c3
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
255e7f1b8eebd0df68030289a22e9c3c4d6efa3d 03-Jan-2013 Jay Shrauner <shrauner@google.com> Fix collation/indexing for i18n contacts

Fix issue of contacts appearing under wrong label--sort contacts by
sort key, not by label.

Fix handling of labels that require more than the first character
(eg Czech 'CH') by using entire sortkey--not just the first letter--
to determine label.

Bug:7351596
Change-Id: Iaabc63041540f621220d0463df3e0850684caa94
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
c231bb10ca1ae310568a0c7cb4f327e348ecde3b 22-Dec-2012 Chiao Cheng <chiaocheng@google.com> Fixing missing punctuation for punctuation search case.

Previous CL I9cbdf10d21c79f53bc621bacb7eeeb95a6a2435f fixed missing
punctuation at the start when searching without punctuation. (e.g.
{hello})

This CL fixes the case where leading punctuation is missing if you searched
with a leading punctuation. (e.g. {'hello}). The content provider
uses a different code path when it detects multi-words and snippeting
is actually done in sqlite using the FTS snippet method. The check for
multi-word was treating {'hello} as two words.

This means that multi-word searches will still have this issue as it still
uses the sqlite snippet method. Leaving this to a separate CL since it's
a riskier change.

Bug: 5929143
Change-Id: I4c2451b2e8eb47d5831e6ef6cfcca538ff3599b9
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
e7fd96a61006c1be2e0713282a5a10531efc2ae5 26-Nov-2012 Chiao Cheng <chiaocheng@google.com> am 75a0a0b0: am dacd5de1: Change default sort order for email queries.

* commit '75a0a0b0ece29241b4712126af53841d5dcdb442':
Change default sort order for email queries.
75a0a0b0ece29241b4712126af53841d5dcdb442 26-Nov-2012 Chiao Cheng <chiaocheng@google.com> am dacd5de1: Change default sort order for email queries.

* commit 'dacd5de146b413de86d38b6f56a3fe0b2af4b155':
Change default sort order for email queries.
dacd5de146b413de86d38b6f56a3fe0b2af4b155 17-Nov-2012 Chiao Cheng <chiaocheng@google.com> Change default sort order for email queries.

- Prioritizing "default" emails over last used emails.
- Added ordering for same domain emails as last order by.

Bug: 7183241
Bug: 7346215
Change-Id: I6a8ba3cfe08792693eec4896f16853a88713bc3f
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
874e0edc8875776588dd42dca29cdb0a10b76eb0 02-Oct-2012 Makoto Onuki <omakoto@google.com> am 94fc236d: am 0e014723: am 2a9d1fab: Merge "Make CONTACTS_AS_MULTI_VCARD locale safe"

* commit '94fc236d199460bddc390ce7f384b446c14df622':
Make CONTACTS_AS_MULTI_VCARD locale safe
94fc236d199460bddc390ce7f384b446c14df622 02-Oct-2012 Makoto Onuki <omakoto@google.com> am 0e014723: am 2a9d1fab: Merge "Make CONTACTS_AS_MULTI_VCARD locale safe"

* commit '0e014723e6d5d2acc3d59b78cee9a6d1fbfef1e9':
Make CONTACTS_AS_MULTI_VCARD locale safe
0e014723e6d5d2acc3d59b78cee9a6d1fbfef1e9 02-Oct-2012 Makoto Onuki <omakoto@google.com> am 2a9d1fab: Merge "Make CONTACTS_AS_MULTI_VCARD locale safe"

* commit '2a9d1fab1669d2962aa830872f063c1180fbea94':
Make CONTACTS_AS_MULTI_VCARD locale safe
bbdc6f0ca72a83c2a2ddd7bdc155c5b4a00cb7e8 02-Oct-2012 Piotr Jastrzebski <haaawk@google.com> Merge "Cancellation of queries for search suggestions."
0788053f47eb6bc66b99a8747351ece2db7c3871 02-Oct-2012 Johan Redestig <johan.redestig@sonymobile.com> Make CONTACTS_AS_MULTI_VCARD locale safe

SimpleDateFormat was used with the default locale to build
SQL statements; this is unsafe for some locales. Switched
to Locale.US.

Change-Id: I7307b12e1f3d796e1bb4a73d97918d0162ca971e
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
d2f6ad6d50b5570327f8cca3b2d2bdcaec36ea90 01-Oct-2012 Makoto Onuki <omakoto@google.com> Make sure to rebuild search index on locale changes...

so that search will still work even after changing the locale.

- Rebuild the search index upon locale changes, as it contains
locale-sensitive data.

- Also make sure to update the in-memory collator in NameNormalizer
upon locale changes.

- Rebuild the search index on the next db upgrade in order to fix the
search index which already contains invalid data.

Bug 7251461

Change-Id: Id579a67de792a52a0091bf76d7c5d374f76f1639
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
bdf112f12eafe116bbf931a0c4158a6fb5713b3f 28-Sep-2012 Piotr Jastrzebski <haaawk@google.com> Cancellation of queries for search suggestions.

Passing CancellableSignal from ContactsProvider2.queryLocal to
GlobalSearchSupport.handleSearchSuggestionsQuery,
GlobalSearchSupport.addSearchSuggestionsBasedOnFilter and
SQLiteDatabase.rawQuery.

Search App needs this change to cancel queries for search suggestions which are
no longer valid due to some user action.

Change-Id: Ie019afff31bf49ba96a88899e829813075ab141e
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
9ff2587608416b4378767141ad396f51f23040a7 28-Sep-2012 Makoto Onuki <omakoto@google.com> Make sure to invalidate fast index cache when

aggregation changes.

Bug 7249008

Change-Id: I6022dca2e56a6a4cdfcde4d936289881a40d1012
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
7b4a5d522df5282cd7dac655b4c673c06d1f449b 27-Sep-2012 Jeff Sharkey <jsharkey@android.com> Remove Secure setting usage.

Bug: 7232230
Change-Id: Ie40bda16e24df96530c80506a74747a4b2c16cb5
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
6db6c6d74da066cbbe3e3b5b89caf1ba5626d240 07-Sep-2012 Yorke Lee <yorkelee@google.com> Change fallback method for contact matching

Modified the fallback method that is used for contact matching
whenever the original query fails to return a result. We previously
performed a 7 digit match but this resulted in problems such as false
positives when the area code is changed but the last 7 digits of
a number are the same. The new fallback method uses the GB method
of matching via the SQLite function phone_number_compare_loose.

Bug: 7000177
Change-Id: I597b4b9e44ab2c4e4a5381832a3e9dfd0d51cf8f
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
14a595d1d4b9e4616aa4f7a184f37b12e07049a2 20-Jul-2012 Makoto Onuki <omakoto@google.com> am d109b237: am ff91ec35: Tolerate crashes during re-aggregation.

* commit 'd109b23736e4171d23356642bd5dbe28743341da':
Tolerate crashes during re-aggregation.
ff91ec356f1b17dea095a880f61b8bc4ff333b1e 18-Jul-2012 Makoto Onuki <omakoto@google.com> Tolerate crashes during re-aggregation.

This CL consists of two parts:
- Don't crash even if the name_lookup table contains malformed data. Just
treat it as name-unmatch.

- Don't crash even if an exception is thrown durign re-aggregation.
Re-aggregation is not *that* important anyway, so in that case just bump the
logic version and start the provider normally. (And even if we fail to bump
the version number, just go ahead and continue.)

Bug 6827136
Change-Id: Ifa3d4697c5d81f3480e0b8a9238b49312ac75e3b
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
38210445730ee04c351c7cc1b3800cfe23e34325 27-Jun-2012 Makoto Onuki <omakoto@google.com> Reorganize import in contacts provider

Change-Id: If3afb134ea36bd93859efcd114885526e1592b91
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
ae32283e7fc5b749df96523d8bb343b9068b65ba 09-May-2012 Makoto Onuki <omakoto@google.com> Fix transaction handling in the provider

Fixed issues that will happen when a batch operation for applyBatch()
contain operations for both the contacts db and the profile db.

- Make sure to set the right transaction listener when starting a transaction.
There were cases where we started a transaction on the contacts db but passsing
the profile provider as the listener, and vice versa.

- Make sure transaction callbacks operate on the correct DB.
There were cases where ContactsProvider2.onCommit() and its sbilings would
operate on the profile DB, not on the contacts db.

- Change the transaction finishing order.
When we start transactions on both the contacts and the profile DB, we do so
on the contacts db first, and then on the profile db. But when we clsoe them,
we did it in the same order, which could potentially cause a deadlock.
Now we close them in the reverse order; the profile db first, then the
contacts db.

- Remove mActiveDb.
This wasn't set in switchTo{Profile,Contact}Mode(), but was lazily initialized.
But I wasn't too sure if I always set the right db at the right timing.
Looks like I forgot to do so in a few cases. Let's just remove it and always
explicitly get the database from the current db helper.

Bug 6250673

Change-Id: Idd18fc173596c973d0ff8b6e1b2456715c0f14f8
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
4c3a04572ead6ad9f0cfc20a34db3252fdb31201 16-Jun-2012 Makoto Onuki <omakoto@google.com> Support new query parameters introduced in Iaab5c38a

The new query parameters controls which field hone.CONTENT_FILTER_URI should
search.

Bug 6662259

Change-Id: I6f4cb4439dc4414cb96cf6a9fc66d0758ddf9faa
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
76afa00cde0c8d407abf3597359280372fd85d41 15-May-2012 Makoto Onuki <omakoto@google.com> Don't wait for read access latch in provider.getType()

until really necessary.

Bug 6434853

Change-Id: I8f1d898f866b3b8016d720b80f8ffb8caac5048b
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
11c3f85ab75cd21a1975025c6d8614e710161baa 08-May-2012 Jeff Brown <jeffbrown@google.com> Move CancellationSignal to android.os package.

Bug: 6427830
Change-Id: I9e856990512253fe2ca4cc2079d195a7fa991151
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
2fe1f4f757a84cb76382c375ba3755a802c5e444 04-May-2012 Makoto Onuki <omakoto@google.com> More detailed verbose log from contacts provider

Change-Id: I4723c245d4dd93b130552e8257045c0419e0dc6b
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
80628945e7e41bb9363c2fbbd2938890b9217792 30-Apr-2012 Makoto Onuki <omakoto@google.com> Don't show the invisible in frequent

Bug 6000492

Change-Id: I5959cad0e3c04476a1b133508c60cdb8037b16f7
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
9d9994ea8f6b02d2c1afb48a9d776c4c26d6c989 23-Apr-2012 Makoto Onuki <omakoto@google.com> Merge "New aggregation logic"
0992b9d4969ed0eee6e879db94292b635229e2b7 11-Apr-2012 Makoto Onuki <omakoto@google.com> New aggregation logic

Now a raw contact can be merged into a contact containing raw contacts from
the same account if there's at least one raw contact in those raw contacts
that shares at least one email address, phone number, or identity.

Now the aggregation logic version is 3.

Also:
- Make sure changes to the identity triggers aggregation.

- Stop re-using some HashMaps/HashSets, as they don't shirink the internal
table when clear()ed. During the aggregation update we may put a bunch of
stuff into those, and we want to make sure that we don't keep unnecessarily
bit internal tables after the upgrade. This should be okay with the modern
dalvik GC.

Change-Id: I855085d334679363cf9bffb918ca2ceb0cfe77f5
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
63630bc7f962fd2b6f2c1bc41cbed45a8bc354ba 17-Apr-2012 Makoto Onuki <omakoto@google.com> Use 3 bucket sorting logic for frequent.

Bug 6343819

Change-Id: Id2a2827fca611e62a5a1406faa73026625feaede
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
87426833d4c2c626e032f5d0b84a08b58024daf6 17-Apr-2012 Makoto Onuki <omakoto@google.com> Fix the last failing photo test

Also add some nice features to the asserts for complex data.
- assertImageRawData() now writes the expected and actual images to the
cache dir when failing.

- assertStoredValues() and its siblings now dump the cursor to logcat
when failing.

Bug 6280711

Change-Id: I77aff61b0494580d0b2ba24b35eb045a18cd48c8
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
dfab50ecd585e55769dea451cb3a47ff69b8b86d 14-Apr-2012 Makoto Onuki <omakoto@google.com> Fix and simplify data usage feedback

Now it correctly updates both raw_contacts and contacts too, with fewer
sqls and less memory.

Bug 6326418

Change-Id: I89f0f92bae5bad5505b218eca2a29ae56b51fe7f
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
b6186821548995dce533ee502e82e9abf4c0aadc 13-Apr-2012 Makoto Onuki <omakoto@google.com> Use new URI for deleting usage stats

Bug 5475575

Change-Id: I11894ef80727e2dc22e73330a5afca41c189135b
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
4e9806e2b347fdbd692d19aeb4fcfd117ebce36e 13-Apr-2012 Makoto Onuki <omakoto@google.com> Merge "New API to clear usage stats"
a780048d2caafbd922444b0c08adb81790db4635 13-Apr-2012 Makoto Onuki <omakoto@google.com> New API to clear usage stats

resolver.delete(DataUsageFeedback.FEEDBACK_URI, null, null);

Bug 5475575

Change-Id: I20adaea0350e95a8f8526507ddc1b2bdc8e8fe13
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
d8f49acc7f64e71152a38cc92ecc2996a2e80670 13-Apr-2012 Makoto Onuki <omakoto@google.com> Merge "Fix most of photo tests"
c23a30e0510cf56d1dafddc79d1ab99ae9297a3f 12-Apr-2012 Makoto Onuki <omakoto@google.com> Fix most of photo tests

Adjusting existing unit tests for higher res photos turned out to be tricky,
because the size of the test images were selected for 256x256.
(e.g. cropping tests)

Also we don't want the display photo size to change depending on the running
device.

So let's just keep using 256x256 for all unit tests.

Added new asserts to EvenMoreAssert to compare image raw data, which prints
actual/expected dimensions when it fails.

Even with this CL, ContactsProvider2Test.testInputStreamForPhoto() still fails
with the following assert message. The image size seems to be correct, so I'm
not sure why. This may be because we've changed the compression rate, but
I didn't dig into it.

"Different data lengths: expected=1088 actual=1578,
expected dimentions=[96 x 96] actual dimentions=[96 x 96]"

Anyway, with this CL at least PhotoStoreTest will no longer crash, so let's
merge it now and take care of the failing test later.

Change-Id: I935f76acee3c2de99030c62e14f43de07074fb8a
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
321b8325f2adc4b017237b4fe010a7f0f2b017ad 11-Apr-2012 Makoto Onuki <omakoto@google.com> Fix " Cannot bind argument at index 1..." crash

Even when the specified account doesn't exist, we can't just replace
the entire selection with (1=2), because the orignal selection may have query
parameters. Let's just append "AND (1=2)" to the original query instead.

Bug 6295580

Change-Id: Ida13f17fe645329b1b1d5de76252abfb0fcbe282
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
e5165be5b87b41e73d4c6e068c658ff1bfe3f0ac 12-Apr-2012 Makoto Onuki <omakoto@google.com> Merge "Dont show invisible contacts in frequent."
db0e85645ffe5a79500b31390149507ac432a2d9 12-Apr-2012 Makoto Onuki <omakoto@google.com> Dont show invisible contacts in frequent.

Bug 6000492

Change-Id: I0e316f294feca805038611e0449fddcbda0b2deb
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
b7e305c1ad38f1e2058453f7412e51477adf8a24 10-Apr-2012 Makoto Onuki <omakoto@google.com> System prop to keep stale account data

If set to 1 (adb shell setprop debug.contacts.ksad 1) the provider
won't remvoe any data when accounts are removed.

This should be used sparingly; even though there are data still available,
the UI don't know anything about them, so they won't show up in the contact
filter screen, and the contact card/editor may get confused to see unknown
custom mimetypes.

Change-Id: Id036d7e0dd68b84bba953690a74648b25cf090b8
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
eae25ef81bfe12946f50c72be9647447bb2a16b5 03-Apr-2012 Daniel Lehmann <lehmannd@google.com> Increase the photo size to 480x480 or 720x720, depending on device

Bug:6202229

Change-Id: I98b38023585d154eccad302578f796a2318fd5b2
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
fb25f3a5a86ca15de8507baf02a357a63032af62 28-Mar-2012 Makoto Onuki <omakoto@google.com> Clear in-memory caches when rolling back transaction

Bug 6245089

Change-Id: I4fe92fbf190090b6e25a411c8c0e2f9885564952
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
ce9aaecfe56e708d5f8fa9713e07c013731f27ab 28-Mar-2012 Makoto Onuki <omakoto@google.com> Merge "Revert ""Rollback" mimetype cache""
c65c6bd3a52ece11a7ed60c20d6bf4c000bd70c7 28-Mar-2012 Makoto Onuki <omakoto@google.com> Revert ""Rollback" mimetype cache"

This reverts commit c624ff13d5df4848a6ec605e25ea8469dd677d5d

Due to b/6123232
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
1c8a00185781fa5e1124e9c11463ed58c4a24be1 28-Mar-2012 Makoto Onuki <omakoto@google.com> Merge ""Rollback" mimetype cache"
c624ff13d5df4848a6ec605e25ea8469dd677d5d 28-Mar-2012 Makoto Onuki <omakoto@google.com> "Rollback" mimetype cache

Bug 6239243

Change-Id: Icf473e5178a76fda66b33fc11875f00d87b36c16
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
4311d471a6666c20809f740331f146957c61af48 27-Mar-2012 Makoto Onuki <omakoto@google.com> Merge "Add new package aggregation.util"
81567f4a0f7c9c338506bd82f4d33e83c2ccf159 23-Mar-2012 Makoto Onuki <omakoto@google.com> Add new package aggregation.util

Move aggregator related classes into it.

Change-Id: I712fe07ad2bab1e532e3822e3e2797a199329865
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
084fe28445cf74e3fa93522f8f8e5da6e065b8c3 23-Mar-2012 Makoto Onuki <omakoto@google.com> Make informational queries respect requested projection

Fixed:
- DisplayPhoto.CONTENT_MAX_DIMENSIONS_URI
- StreamItems.CONTENT_LIMIT_URI

Also now ProviderStatus now throws when a non-existent column is requested.

Change-Id: I03c82c31fe78a30d4929335dfb8efc3bff3bc76b
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
565b62f354d8b6aadc760092a7dbf483f8bbbe17 08-Mar-2012 Makoto Onuki <omakoto@google.com> Use wall time instead of CPU time for performance log

Apparently what currentThreadTimeMillis() returns is the CPU time,
not wall time, which is not really interesting when we measure
performance. Use the actual wall time instead.

Change-Id: Ibe2e385ff1bdeeb1128a584c79925210dde5525a
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
49ed71913609193a00059df944f6259e9397b0bd 05-Mar-2012 Makoto Onuki <omakoto@google.com> Move aggregator to its own package

... so that methods used only by ProfileAggregator don't have to be public.

And fix some method visibilities that don't make sense.

Needed to change the bogus ID in PhotoStoreTest; otherwise moving the
aggregator test will make this test fail for some unclear reason.

Bug 6118852

Change-Id: Ic0c022cbf50128f40c70559c1a7cf8e2a6c06fc8
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
47ad37083874664d5983627c3ecd8e1c9e86a6f8 01-Mar-2012 Makoto Onuki <omakoto@google.com> Add log to openAssetFile() and query()

(And remove from queryLocal)

To understand better what data is accessed.

Change-Id: Ib59de2336e291a1d19dc9c7b6bd6cb87f0d67f05
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
674f943e22077ae399166d5fe8db96dd3d1f7259 18-Feb-2012 Makoto Onuki <omakoto@google.com> Remove in-memory account cache

Bug 6026073

Change-Id: Ic6057aa2347d1fa4c245ad2f6644ac4d5e8ae3cf
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
5acb3e091bc334d4e0f367a36f8d62a0add02b39 16-Feb-2012 Makoto Onuki <omakoto@google.com> Fix deadlock caused by the fast indexer cache

Also,
- Split up putAndGetBundle() into put() and buildExtraBundle().
The old design was to avoid taking a Bundle as a parameter, which
I generally don't like because it's not self-descrictive.
But splitting it up makes the structure of bundleFastScrollingIndexExtras
much cleaner -- the get() and put() calls are now in a single method,
bundleFastScrollingIndexExtras().

- Removed mFastScrollingIndexCacheLock. I don't really like synchronizing
on a non final member either, but mFastScrollingIndexCache is essentially
final, so I decided to be lazy.

Bug 6020589

Change-Id: If842e52e5334452a52cf8d19c460d52329fc81f4
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
5a515c25c5b43964c97941bfc13b125f9ff068f9 15-Feb-2012 Makoto Onuki <omakoto@google.com> Merge "Cache fast scrolling index."
35997f3fdee2984b6d5373326110eda26929001a 06-Feb-2012 Makoto Onuki <omakoto@google.com> Cache fast scrolling index.

The cache content is also stored in the shared preferences.

The cache is invalidated when:
- contacts (or profile), raw_contacs, or data is modifiled.
- accounts are changed. (Strictly speaking we have to do this only when
an account is being removed, but not when added. But let's just always do this
for just in case.)
- visible contacts are updated; i.e. when custom filter is udpated.
- the locale changes.

Change-Id: I70cfe7c88d3b1a0a0f820338acbe885c136b6e10
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
85ff6534e410880d51b30a3ce362c0d3798375ca 07-Feb-2012 Daniel Lehmann <lehmannd@google.com> Merge "Fix broken sub-QueryBuilder. Instead of selecting only photos, this selected all kinds of data rows :-("
cde9e5e83f7c3a6bf341f9f2fa2359a1ed127f95 07-Feb-2012 Daniel Lehmann <lehmannd@google.com> Fix broken sub-QueryBuilder. Instead of selecting only photos, this
selected all kinds of data rows :-(

Change-Id: Iccfd5573d1f2661d6d5ba660ad4fef12cbc4adbd
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
5f673b204620c4c241b3b39c6ac0ee063d22f13b 06-Feb-2012 Makoto Onuki <omakoto@google.com> Fix G+ crash during account switch

Make sure Raw_contacts / groups deletion works with account column selection.

Bug 5970976

Change-Id: If32f716576d6e4362f72f32289aebce012d19e2f
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
74e8f30b3a67af4defd8f73c503e794785671fee 03-Feb-2012 Makoto Onuki <omakoto@google.com> Add debug logs to applyBatch

Change-Id: I646c7e091c2e778516e6287e3e91770e556ad71f
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
7898a8e97722d5bf0db3c04107b2957b998c0332 03-Feb-2012 Jeff Brown <jeffbrown@google.com> Rename CancellationSignal using preferred spelling.

Bug: 5943637
Change-Id: I223a5e76627cdd604ebb147832f0fb086cb4a5f3
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
e5eefd3998ea1180bd550d2771bd9b83bb5ad6f4 01-Feb-2012 Makoto Onuki <omakoto@google.com> Merge "Fix proguard flags"
15826b1a7fd6d7a5be9223a61d49c0b532ccf01e 31-Jan-2012 Daniel Lehmann <lehmannd@google.com> Pass through the cancelation signal

Change-Id: I248c7817a50a257ec5c2001e529ec4453f7e11cc
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
833072a525ea45426082d3bac0cd6ae1a8c36f22 27-Jan-2012 Makoto Onuki <omakoto@google.com> Fix proguard flags

Removed the *ForTest exception. It caused issues with guava. Now that
we have NeededForTesting, we don't really need it.

(But didn't change method names from XxxForTest to Xxx, because I still
think using this prefix for test-only methods is a good idea, as it'll
make it easier to catch the use of methods in the main apk that are
not supposed to be used.)

Change-Id: Idccfd7175372b1a2253b19161ae572dae7e1e952
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
fba89ea92f519d77ec1d762724ed11bf4ebb7d20 24-Jan-2012 Makoto Onuki <omakoto@google.com> Fix for broken phone number snippet

Don't add snippet markers when snippetizing is deferrerd.

Bug 5904515

Change-Id: I7199e1d68659e06e2b183383b7ba4d8a089aec87
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
9ba8463dd030e5e26a4f99dfe2a6ad52b2410d73 11-Jan-2012 Makoto Onuki <omakoto@google.com> Account refactoring follow-up

- Check if there's really a new or removed account in
updateAccountsInBackground() before doing everything else.
If there's none, we'll skip re-scanning directories too.

- Preheat the account cache when the provider starts.

- Use account_id for the account filter query parameters. The contacts URI
now supports the parameters too.

Change-Id: I12e1116890df4c20b354618acfaee9dc009dc68e
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
9d990d339c9e3a9e03f6fe13c260d36665f00e61 16-Dec-2011 Makoto Onuki <omakoto@google.com> Account table refactoring

- Remove the account columns (type, name, data_set) from the
raw_contacts/groups tables and add account_id instead.

- Re-create the accounts table. The new table now has the _ID column. Rows
in this table now has a different lifecyle than before:
-- New row is created as the provider detects a new account during a write
operation to the raw_contacts and groups table.
-- Stale rows are removed upon account removal.

- Removed account consistency check for steam items/photos. We don't do this
kind of check for other tables.

Change-Id: I1ce01590aef70f417fa89426dae762a41d25d656
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
56abe81ced08c7af625b3eb8dd543f9030da9bad 20-Dec-2011 Dave Santoro <dsantoro@google.com> More aggressive fix for phone lookup issues.

Rather than relying on a trailing suffix match on the longer of the
two numbers (the one from caller ID and the one in the database),
this first attempts to do the full internationalized-number-aware
query that we'd normally do, and if no results are returned, falls
back to a comparison of the trailing 7 digits of each number, as
we did in Gingerbread.

Bug: 5742389

Change-Id: I085fe9df336c6d75008423163965c39d91bcd1ce
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
fc42772538fc6f7e2e444cbe6b24e06a3fbf933d 14-Dec-2011 Makoto Onuki <omakoto@google.com> Use ContactContract.Phone instead of internal definition

PhoneColumns was just redundant, and only made it hard to find all usecases
of Phone.NORMALIZED_NUMBER.

Also makred GroupsTest as @MediumTest. Some methods didn't have a size
annotations so they weren't executed as we always have to use the "-e size"
parameter.

Change-Id: I53160219e2ab6b2535cc8be61b07af6312bc92fc
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
47106a03cd4587123f4fa24f3620baf55fed15d9 13-Dec-2011 Dave Santoro <dsantoro@google.com> Moving ProjectionMap to frameworks/ex.

Change-Id: I3ccd0dd27ff0fe49ac54574449264c2e957d3a01
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
4c4ea154ba08f2c772d645a092c3ffa4497295df 03-Dec-2011 Daisuke Miyakawa <dmiyakawa@google.com> Prefer usage stat to in_visible_group flag

Bug: 5524077
Change-Id: Ic5a5c541d2e59264f38c26ea991df5bee14b7884
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
fa5cdd337d4d696d326db03c68bfae8645c83b14 21-Nov-2011 Mathew Inwood <mathewi@google.com> Unify and improve isPhoneNumber checks.

- Unify GlobalSearchSupport and ContactsProvider2 isPhoneNumber methods
- Improve phone number recognition for gloval search, using the detected
current country and the SIM country.
- Show 'Create contact' and 'Dial number' suggestion in global search
if there's a contact match too. Otherwise, you can't dial a number
that happens to be a substring of a contacts number.
- Move isVoiceCapable check from GlobalSearchSupport into ContactsProviders
to resolve some testing issues.
- Show 'Create contact' suggestions on tablets.

Bug: 5554109

Change-Id: Ie0afee2a97d7551a267482970f5e0615f1775c7d
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
43825420ddcac27e58645962e02b19b6a8791042 29-Nov-2011 Dave Santoro <dsantoro@google.com> Merge "Fix cross-process cursor logic."
10178e5e0b9de566e04508b624a89860c61787d6 24-Nov-2011 Makoto Onuki <omakoto@google.com> Remove LegacyContactImporter

Contact data migration from donut is no longer supported.

Bug 5664971

Change-Id: I01c56752d93bb0f8e2a0e6ff81285f1971a7c893
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
6bb8f22fe3bbcc00f6180a10173e12e7e58f7b5c 28-Nov-2011 Makoto Onuki <omakoto@google.com> Merge "Fix NPEs during ContactsProvider2Test"
887a804b03fcb37be1fde000945dcfd799b3c012 24-Nov-2011 Makoto Onuki <omakoto@google.com> Fix NPEs during ContactsProvider2Test

This happend if a raw_contact had null account name. Apparently some tests
will leave such records. Turned out streamItemPhotoIdToAccount wasn't actually
used, so I just removed it.

Also now ContactsProvider2.onCreate() doesn't supress exceptions if running
unittests.

Also removed ContactAggregatorPerformanceTest, which was failing to initialize
the provider as well. It was essentially disabled2 years ago anyway in
Id076a108.

Bug 5664700

Change-Id: I0b7fb0834965058886aa816a47629b93b86a6e13
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
18b09495f5f37b38ff2e1c965e087dfde68c27fb 23-Nov-2011 Makoto Onuki <omakoto@google.com> Remove SUMMARY_GROUP_COUNT_PER_ACCOUNT support (for now)

This sub-query needs to be rewritten for the upcoming accounts
refactoring, but since it's @hide'ed and no one is using it, let's
just remove it for now.

I believe this count can be implemented efficiently using a join
(in a similar way we support SUMMARY_COUNT) rather than a subquery, but
this should be even easier after the refactoring.

Also when we re-implement this, we can just check if the projection
contains SUMMARY_GROUP_COUNT_PER_ACCOUNT, so we'll probably be able to
remove PARAM_RETURN_GROUP_COUNT_PER_ACCOUNT.

Change-Id: I3adc93cdf57280ab06b4a2cab77f834811178af8
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
b6b22df3a64a80531d58f9cd60f2872fc2af92d1 02-Nov-2011 Dave Santoro <dsantoro@google.com> Fix cross-process cursor logic.

This fixes some issues with our cross-process cursor handling,
per Jeff Brown's recommendations.

Bug 5220669

Change-Id: If6599f0e7986cc4cc678b2123fcd694973b42034
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
193f2da3b4c3e019cc3a85a7101478332b1869ec 22-Nov-2011 Makoto Onuki <omakoto@google.com> Minor cleanup for ContactsProvider2

- Add final when applicable
- Renamed some constants for consistency
- Use @VisibleForTesting
- Other minor clean-ups

Change-Id: I4dc835c8b099334ee51f8c8e9a5e7e5629b717d5
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
2043d0e274e2fd11e0a43d89c2214ab2e6537619 19-Nov-2011 Makoto Onuki <omakoto@google.com> Merge "Remove hasColumn() and use isInProjection() instead."
ac2a6e814edb3d5e5bcca28d7d3f3977a489c2ed 18-Nov-2011 Makoto Onuki <omakoto@google.com> Remove hasColumn() and use isInProjection() instead.

When I added hasColumn I didn't realize there was already a similar method.

Bug 5545880

Change-Id: I9ba62a9ff8b3eeab8098626426a37fd84c77d679
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
e432023d408c461295e53c0593fabb2b4c17aeb3 23-Oct-2011 Daisuke Miyakawa <dmiyakawa@google.com> Add Callable URI support

This must be after I4729c87ecd11296599ed0313e8ad1f5aeabbd32b, which
introduces URIs this change depends on.

- CONTENT_URI will return a list containing both phone numbers and
sip addresses.
- CONTENT_FILTER_URI will return a list containing both, filtered
by a parameter. The URI will return addresses starting from
"sip:" too just for convenience. If a user type "johndoe",
sip addresses like "sip:johndoe@example.com" will also be returned.

Bug: 5039627
Change-Id: Ifbbfe9df3b9a560666d35ca78aeb07d513963195
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
a99ffbd887e5120951845e5c60c32f459f71e9f2 16-Nov-2011 Makoto Onuki <omakoto@google.com> Fix for arabic crash

Make sure not to localize when using String.format to build SQL.

Bug 5619742

Change-Id: I66fd9c4a50dd6c083099a9def93840ff05aed5a6
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
38f1fd23d523be9d8706b172c338d2a45d8f06ff 15-Nov-2011 Daniel Lehmann <lehmannd@google.com> Merge "Optimize STREQUENT queries and fix estimated table row counts" into ics-mr1
72c4b2612a06636343e2803c0c84fdfbd5ba2f63 15-Nov-2011 Daniel Lehmann <lehmannd@google.com> Optimize STREQUENT queries and fix estimated table row counts

- Use id instead of strings for matching mimetypes
- Use inner LIMIT of 25 to prevent the extra subquery
(also fixes correctness)
- Reorder JOIN for data-usage-stat JOIN contacts
- Defeat sqlite3's "optimization" attempt by using +0 on fields
from contacts/data <-- This is huge

Bug:5560534

Change-Id: I412d359afe07f32643cc2faef8735b719686741f
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
8ead0dc62d0031a22af0d14c7ed05893507893c9 11-Nov-2011 Daisuke Miyakawa <dmiyakawa@google.com> Allow the provider to conditionally remove duplicate entries

Must be after Ie88af0c3d21919ca201f4fcdd46ca09e9f8d94c0, which
introduced the new flag for duplication removal.

With this change the default behavior for Phone uri will be back
to the behavior before Ie21abb12736715358dd33bc690269f51ae1e0944
being introduced.

Bug: 5484956
Change-Id: I3b6ba3956449520f9e08653fc8beead763a5f8a1
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
071d0e7bd3b2f3c9628dd655b09d147e668c3931 08-Nov-2011 Daniel Lehmann <lehmannd@google.com> In Email-lookup query, prefer visible over invisible contacts

Bug:5578303
Change-Id: I29beb8ce7ab0745b9f57b399fe017d60fbb96285
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
58795e447fada97b9594bd7ba2e3dca241487d01 02-Nov-2011 Flavio Lerda <flerda@google.com> Add support for looking up SIP addresses.

Current ContactsContract.PhoneLookup only support looking up phone
number. As a consequence SIP address look-ups are done with a generic,
expensive ContactsContract.Data query.

This change adds support for doing a SIP address look-up using
ContactsContract.PhoneLookup by specifying a query parameter.

By doing so, we can do a trivial but crucial optimization: instead of
matching against the MIME type as a string, we can use the _id of the
vnd.android.cursor.item/sip_address MIME type in our database. This
speeds up queries that used to take over 250ms to 1-2ms.

Bug: 5529690
Change-Id: I15e7ed225927882fc0fd0958b7d2cbfede12c590
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
437d183d6ac71c9f5e0b75ee28f76956c3749ea7 01-Nov-2011 Daniel Lehmann <lehmannd@google.com> am 1322df8f: Fix extreme slowness in FTS search

* commit '1322df8f90d80587748ad10539516635326c01e8':
Fix extreme slowness in FTS search
1322df8f90d80587748ad10539516635326c01e8 31-Oct-2011 Daniel Lehmann <lehmannd@google.com> Fix extreme slowness in FTS search

Bug:5534735
Change-Id: I561bcf32d3c66b1a86b36a043d407a725325419d
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
23ba865a6d204ba4aa29d2fad9989e9c44351e81 27-Oct-2011 Makoto Onuki <omakoto@google.com> Speed up query for group tab

- The old query had overhead propotional to the number of groups.
- The Groups.SUMMARY_WITH_PHONES column is still slow, but we don't use it.
- We can use the same technique for Groups.SUMMARY_GROUP_COUNT_PER_ACCOUNT.

The only downside is that, we're changing the FROM clause dynamically according
to the requested column, which is something that we don't usually do.
Overusing this technique could make code less maintainable...

Bug 5092615

Change-Id: I79b01ae2a232bcd8e3b7186288050fed14a36a72
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
679acd3308fb51ba24f247798a610da7e681a6c5 24-Oct-2011 Dave Santoro <dsantoro@google.com> am 5dccfb05: Fix deadlock case when removing accounts.

* commit '5dccfb059f5df0e9fdba026bcfbed677f44922cd':
Fix deadlock case when removing accounts.
5dccfb059f5df0e9fdba026bcfbed677f44922cd 22-Oct-2011 Dave Santoro <dsantoro@google.com> Fix deadlock case when removing accounts.

The account cleanup flow generally operates on one database (either
contacts DB or profile DB), bringing the account set up-to-date with
the accounts that remain in the system. However, the code was also
doing an update of the search index, which is bad in the profile case
because the search index is only associated with the contacts DB, and
threads must never ever open a profile transaction and then open a
contacts transaction (or deadlocks may occur).

This fixes the issue by skipping the pointless search index update if
in profile mode, but longer-term it would be good to get rid of code
that starts DB transactions outside of using ContactsTransaction.

Bug 5496295

Change-Id: Ieb4d42a21f85a85f18a4415463ea7c8dd3cc2477
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
906cae61cada57539a87d25ca4fbe099836cf896 17-Oct-2011 Daniel Lehmann <lehmannd@google.com> Merge "Remove Live-Folders"
4004a43c7fbe48ba72de46cc88eb5567df184258 17-Oct-2011 Daniel Lehmann <lehmannd@google.com> Remove Live-Folders

Bug:5254892
Change-Id: I41cf5df369b887361e545d9e0acccef308824875
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
9650d6727d11ce4665912da15cede15a578c5925 15-Oct-2011 Daniel Lehmann <lehmannd@google.com> Merge "Use hexadecimal collation key for name searches." into ics-mr0
d1746e09bc7739f3d1449cececc66d5045ada498 15-Oct-2011 Daniel Lehmann <lehmannd@google.com> Use hexadecimal collation key for name searches.

Also allow prefix search on name

Bug:5337763

Change-Id: I039264be0c8309224d8925ded06ab02a64a5ce1b
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
d0eb93009559d095de0448907527aeb059801dc4 14-Oct-2011 Dave Santoro <dsantoro@google.com> Switch to using SecureRandom for tokens.

Bug 5462343

Change-Id: Ie54fc63eea215491f7e9d842a054996454765fb6
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
73dab78ab7f87124b9500236e6c9b3ef240687d2 14-Oct-2011 Dave Santoro <dsantoro@google.com> Merge "Detect profile VCard URIs and support tokens." into ics-mr0
82792ae937085bfa1f7878166e89ca4ea84fd652 10-Oct-2011 Dave Santoro <dsantoro@google.com> Detect profile VCard URIs and support tokens.

This fixes the URI matcher to interpret VCard URIs for the profile
properly, and adds support in the provider side for pre-authorizing
URIs using temporary permission tokens.

Bug 5437453

Change-Id: I37bb6f759df833a3f007faef1eb35fb1434f7df2
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
897e51661e0cb08c0f2d3e59136a1a6f8ceb2316 13-Oct-2011 Daisuke Miyakawa <dmiyakawa@google.com> Omit "other contacts" in contacts search again

Per bug 5336673 search_index now has index for "other contacts", which
isn't appropriate for People UI's contacts search. This change let
the contacts filter omit them using WHERE clause.

See also Ib77acdfa6968605a66561f0925d0aa81f4522bb9, which introduced
the search_index modification.

Bug: 5457264
Change-Id: Ia5dfc7ff33d503b9fe814ee0ec058e85cee0b9c8
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
d9125effce84804631c8e618ae88b2cfc69cf529 07-Oct-2011 Dave Santoro <dsantoro@google.com> Use internal APIs for cleaning up photos.

This avoids running into security exceptions when the cleanup
involves permission-protected data.

Bug 5422732

Change-Id: I5554d53ca76c5d513467c66782f7bf3ea61aa78b
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
3a2043b8a68a800d4b1bedb88fbc0e1da8ce4d80 05-Oct-2011 Dave Santoro <dsantoro@google.com> am 36612112: Implement new social stream permissions.

* commit '36612112760df799ef89f7e324e5dfabd5ca0d2b':
Implement new social stream permissions.
36612112760df799ef89f7e324e5dfabd5ca0d2b 04-Oct-2011 Dave Santoro <dsantoro@google.com> Implement new social stream permissions.

Reading/writing social streams now requires READ_SOCIAL_STREAM or
WRITE_SOCIAL_STREAM permission. The special stream item insertion
that occurs on status update insertion is exempt from this
requirement.

Bug 5406886

Change-Id: I6a711d7f33b501e2c331c71684b2eb3a6bfd5ec5
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
fcc7025b595564cff1bf211cd4089411e9b2f827 28-Sep-2011 Dave Santoro <dsantoro@google.com> am c990980a: Fix deadlock opportunity.

* commit 'c990980ab4beb7b81c3337526f1bdcd5d1a14730':
Fix deadlock opportunity.
c990980ab4beb7b81c3337526f1bdcd5d1a14730 27-Sep-2011 Dave Santoro <dsantoro@google.com> Fix deadlock opportunity.

The Profile provider was not synchronizing all transactions on the
contacts DB as it needed to. During commit, most transactions were
doing queries on the contacts DB. As a result, a profile op thread
could have a profile lock and then try to get a contact lock, and
contact op threads could have a contact lock and try to get a profile
lock while updating provider status.

Ensuring that all transactions first require a lock on the contacts
DB avoids the deadlock scenario.

Bug 5381085

Change-Id: I832e075ea37f0d650187b8ec067677ccee75a838
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
6efb7db26598b105342d02207e0ca1c8725c10da 22-Sep-2011 Dave Santoro <dsantoro@google.com> Fixes and cleanup for transactions.

- Make the thread-local transaction shared between the contacts and
profile providers (as the implementation intended).
- Remove a bunch of extraneous variables from the contacts provider.
- Ensure that the profile provider switches the delegate into profile
mode before running onBegin() or onCommit().
- Port the fix for applying contact changes to the profile DB.
- Fix an issue with profile aggregation after the profile has been
deleted.
- Addressed a case in which we would create (and possibly hold onto)
a profile DB transaction erroneously.
- Ported fix for aggregation when raw contacts are deleted.

Bug 5320369

Change-Id: I1f36d4c87c6b655dfcb5e339f151d3bf1d37a437
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
1744cae1895be1082404220667d1fecf7d148a71 22-Sep-2011 Dave Santoro <dsantoro@google.com> am ae94a710: Merge "Change Settings insert conflict to do an update." into ics-factoryrom

* commit 'ae94a710dbc0ea239277c25986e39ba53904c5fc':
Change Settings insert conflict to do an update.
a9995c98ba99bcdd101bc4734fdb3ff08e9efe8f 22-Sep-2011 Dave Santoro <dsantoro@google.com> Fixes and cleanup for transactions.

- Make the thread-local transaction shared between the contacts and
profile providers (as the implementation intended).
- Remove a bunch of extraneous variables from the contacts provider.
- Ensure that the profile provider switches the delegate into profile
mode before running onBegin() or onCommit().
- Port the fix for applying contact changes to the profile DB.
- Fix an issue with profile aggregation after the profile has been
deleted.
- Addressed a case in which we would create (and possibly hold onto)
a profile DB transaction erroneously.
- Ported fix for aggregation when raw contacts are deleted.

Bug 5320369

Change-Id: I1f36d4c87c6b655dfcb5e339f151d3bf1d37a437
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
79168d502c62f205523a5f804c1df2864d193124 21-Sep-2011 Dave Santoro <dsantoro@google.com> resolved conflicts for merge of 078f588c to master

Change-Id: I17e4d57df3bb24388ca9ead92f9a40fc57bc0fd3
ae94a710dbc0ea239277c25986e39ba53904c5fc 21-Sep-2011 Dave Santoro <dsantoro@google.com> Merge "Change Settings insert conflict to do an update." into ics-factoryrom
0e21a867a572679d64d79041eb574d13665178d4 21-Sep-2011 Dave Santoro <dsantoro@google.com> Change Settings insert conflict to do an update.

This was the behavior the Settings table had before (when uniqueness
was enforced by the primary key), and it was assumed by external
apps, including Twitter.

Bug 5336876

Change-Id: Iab792df6a5d31c780a33ddebabdb26c7768f373b
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
078f588cef389358adabc579de00747878f3c108 21-Sep-2011 Dave Santoro <dsantoro@google.com> Refactor transactions for contacts.

Rather than extending SQLiteContentProvider, the profile and contacts
providers now extend AbstractContactsProvider, which handles keeping
track of a thread-local transaction with awareness of what databases
have been enlisted in the transaction and whether it is being run in
the context of a batch operation.

This is intended to solve the issue of how the content provider can
manage transactions that operate across multiple databases without
risking deadlocks.

Bug 5320369

Change-Id: I08a7d518a3eae1b0bf438402d02f1f1d8e8df7b9
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
85077339f2e0c6f21fd92fb8df335f3aae004fba 20-Sep-2011 Dave Santoro <dsantoro@google.com> Add support for profile/<photo> URIs.

The URIs profile/photo and profile/display_photo can be used to load
the thumbnail and display photo (respectively) for the user's profile
entry.

Also had to move ContactDirectoryManagerTest to MediumTests because
the LargeTests are starting to crash due to the SQL memory issue
again.

Bug 5226635

Change-Id: I7bf9787b06a49bf59c758421552dc969e6c6907d
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
78c48301b4135d02646a705d0de2e76abd904fde 17-Sep-2011 Dave Santoro <dsantoro@google.com> Revert new applyBatch method - it is harmful.

The primary problem is that the overridden method keeps track of
whether we're in a batch operation in the ContactsProvider2 scope,
leaving SQLiteContentProvider out of the loop. Meanwhile, the
SQLiteContentProvider insert/update/delete operations are checking
its own private flag for batch checking, and since that's always
false, they're creating and closing their own transactions
throughout the batch, which completely breaks transactionality
(and the functionality tied to it, like aggregation).

Bug 5320369

Change-Id: Ia7d00a770be179e5bef1226dffff3c2915c38e66
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
d022a80fababc650b4b4f3f5d25b877518aed266 16-Sep-2011 Dave Santoro <dsantoro@google.com> Merge "Fix deadlock in applyBatch."
edd81e0b038f478b857f384617ee29de0d0c894c 16-Sep-2011 Martijn Coenen <maco@google.com> Merge branch 'master' of ssh://android-git:29418/platform/packages/providers/ContactsProvider
1c0ff492c0b308fd88f2d19de9f1b3dc3a672460 15-Sep-2011 Dave Santoro <dsantoro@google.com> Merge "Re-aggregate all data on raw contact delete."
41f76a59a31946f6d784dacf9f13d9a4c0bbe203 15-Sep-2011 Dave Santoro <dsantoro@google.com> Re-aggregate all data on raw contact delete.

Previously it would just re-aggregate the display name, which would
miss things like display photo needing to change.

Bug 5324939

Change-Id: Ia06713c985d727efe117b3f1440af2f280874094
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
3711af1a5799a7ae0c8e761e13a67a9fb5878cc8 13-Sep-2011 Martijn Coenen <maco@google.com> Set the VCardComposer raw contacts URI correctly for the profile.

Bug: 5300714
Change-Id: I87db1056498add7d4c29675fe75b07596242e8d7
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
36aa19fbab3722288b7f0917166ef6990ab7b52c 15-Sep-2011 Dave Santoro <dsantoro@google.com> Fix deadlock in applyBatch.

This is a simple attempt at a fix (as with most deadlocks, hard to
determine whether this really fixes the problem until the fix is
out in the wild for a time).

Bug 5320369

Change-Id: Ibc7634bc41c72303f05d26dc4250ed8ab7e859ec
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
bd20dbedba706fdf2db7acb1c7d4391e57129d44 14-Sep-2011 Dave Santoro <dsantoro@google.com> Add lookup key support for photo URIs.

Bug 5235737

Change-Id: Iec2ef8ada5b70e22e35b6912ab62e6e680309dc6
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
dc586a1fb85149e10e86f65eb532c8aa6f7ab0cc 14-Sep-2011 Dave Santoro <dsantoro@google.com> Merge "Do mimetype filtering based on ID."
7cf50494501938f175d288077145acf49da8f171 13-Sep-2011 Daniel Lehmann <lehmannd@google.com> Do mimetype filtering based on ID.

Wherever the provider is doing a query based on the mimetype, we can
optimize the SQL performance by switching in the (cached) mimetype ID
and joining against that instead.

Also fixed an issue that was likely leading to hi-res photos being
blown away during photo cleanup.

Bug:5289712
Change-Id: Ic51e4c6b0e5daa8b7a2440692755fd87d387f3f3
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
91abbc9f691297594262d1f2d79acb744a66712c 13-Sep-2011 Dave Santoro <dsantoro@google.com> Fix a case that would trigger an account error.

Change-Id: I9e09d60a0a60a151c6c43842a499410b65e33693
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
d9e353f4a13154dace037c99eb1054d85cce2521 09-Sep-2011 Dave Santoro <dsantoro@google.com> Fix URI support for profiles.

Many URIs that have essentially the same functionality for both
contacts and profiles have been collapsed into one case to save code,
and some profile-specific URIs that should have supported operations
have been added.

Also fixed an issue with detecting whether the provider is currently
operating in batch mode, and set up raw contacts to be fully deleted
if they have no associated account (i.e. they are local).

Bug 5284316

Change-Id: Ia6e129a4cdbd0e105be0c1a66c25e4955bdfbfae
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
1a265df05176fb9213048a40bc1bff5900b027e2 09-Sep-2011 Dave Santoro <dsantoro@google.com> Merge "Add data_set for Settings."
f9b77edaf5855bf6932fbc4b4b4342273669efef 09-Sep-2011 Dave Santoro <dsantoro@google.com> Add data_set for Settings.

Since data_set may be null, it can't be part of the primary key
for the table, so we need to re-create the table and add
provider-side protection from inserting duplicate settings
records.

Bug 5156004

Change-Id: I25ae53c5670087a116058f0daef5b06cb6ce372b
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
b9be9c48e39c6fd940a65f4a7070d7f51c642ea0 08-Sep-2011 Isaac Katzenelson <isaack@android.com> Merge "Fix snippetizing cursor"
3202ae2de5c5fec9f5f61003a0e6b608283e1961 08-Sep-2011 Dave Santoro <dsantoro@google.com> Add support for profile raw entities URI.

Bug 5274218

Change-Id: Ic5b0b5ace48dfaea81190b8262c622179f20f617
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
b3a1271feb57be104aabe8046846da0071a1f23e 02-Sep-2011 Isaac Katzenelson <isaack@android.com> Fix snippetizing cursor

Bug: 5217242 Email address with the found "snippet" highlighted should
be displayed on the second line below the contact name
Provider size fix:
Added support for deferred_snippeting parameter to URI.
Replaced the cursor wrapper with a code that inserts a bundle into the cursor
for client side snippeting

Change-Id: I1f411071d3d8552eab3c41303d1a99ab6fe0a801
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
c88cc79e0e19b8299a2a356c7d70b48f70b4a93e 07-Sep-2011 Dave Santoro <dsantoro@google.com> Clean up stream items on account removal.

Bug 5239627

Change-Id: I0c45baeaf6e3a1730760f49696e1f489ef22490f
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
6b556103afd9aa1bdfba8164c462093ef0822f31 07-Sep-2011 Dave Santoro <dsantoro@google.com> Merge "Fix issue with cleaning up stream item photos."
d2ee1503a0de87863c21153c723442328ad79bb7 07-Sep-2011 Flavio Lerda <flerda@google.com> Merge "Fix status message in contact updates."
c2714bbd397b09a20da476c89560e1caecdcce58 07-Sep-2011 Dave Santoro <dsantoro@google.com> Fix issue with cleaning up stream item photos.

Bug 5250048

Change-Id: Ibb0daef7a089ec851a9201cfd4163173f713f839
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
82780691f1a3b4d8784e29a961b1140cd07bc9a8 07-Sep-2011 Dave Santoro <dsantoro@google.com> Clean up stream items when raw contact is deleted.

Also added support for raw_contact/#/stream_items/# URIs, which we
were returning on stream item inserts for a raw contact.

Bug 5239627

Change-Id: I32116b32f1ebd28f7c86d6dc7567fca8f7c7ff07
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
5d9fcbaaa0007134564d63272470296f5d23b62a 03-Sep-2011 Dave Santoro <dsantoro@google.com> Prevent stream item photos from being nuked.

Bug 5250382

Change-Id: Ie121858a4a2c7584f04432e7830bdbeb6cd52bf7
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
a5542f6ec9ef1ee2f54ce85f26d826bd88e4a5b1 03-Sep-2011 Dave Santoro <dsantoro@google.com> Merge "Another fix for the bulk insert problem."
14fa8096cb8d2bc59cace60248f7d08316b3df72 03-Sep-2011 Dave Santoro <dsantoro@google.com> Merge "Add support for I/U/D on profile/data URI."
8d55bbc171bea632e960e0e5a88557cef5e66d92 03-Sep-2011 Dave Santoro <dsantoro@google.com> Another fix for the bulk insert problem.

The insert depends on mDb being set, which our totally-overridden
bulkInsert method didn't do.

Bug 5239086

Change-Id: Id86eee9e5f6a9076dfa29f985d83387ba1ec4f8d
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
0c5812a467378c57c2d2715ee4f0a9f541c64809 03-Sep-2011 Dave Santoro <dsantoro@google.com> Add support for I/U/D on profile/data URI.

Also make sure that deletes of data use the appropriate URI when
querying for the rows to delete if in profile mode.

Bug 5249062
Bug 5201592

Change-Id: I206fb8653bdc111c4cab1e703346fc56502fce65
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
9d4236390716603995c7bdc787ec1c423df8e5db 02-Sep-2011 Makoto Onuki <omakoto@google.com> Merge "Fix alphabetical headers for phone-all contacts"
2ebc62b692be3aaaeafa01d658ae3cdfb25b728a 02-Sep-2011 Makoto Onuki <omakoto@google.com> Fix alphabetical headers for phone-all contacts

- On phone, we dedupe phone numbers using "group by", but we don't
do that in bundleLetterCountExtras, so there'll be mismatch if a contact
has dup numbers.

- The proper fix would be to make bundleLetterCountExtras() respect group by,
but we'd have to use a subquery to do this, and this method is quite tricky
to tweak without risking regression or negative impact on performance.
(I know because I tried to optimize it...)

- So instead, just use count(distinct CONTACT_ID, PHONE NUMBER) instead of
count(*) to count records in this case. But count() takes one argument,
so concatinate these two columns instead, i.e.
count(distinct CONTACT_ID || ',' || PHONE NUMBER)

This change is pretty low-risk, and not as slow as it may look. It only slows
down the query by 14% with 10,000 contacts (1.4sec v.s. 1.6sec).

- We also use group-by for the followin queries, but I don't think they'll
ever be used with addressbook indexer?
CONTACTS_FREQUENT, PHONES_FILTER, EMAILS_FILTER and GROUPS_SUMMARY

Bug 5249927

Change-Id: Ib6f307efafb0a402cbfed74f09e7d28fdd246823
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
072079319b9bd2998b06a2cab0e9b4af6eb05c33 02-Sep-2011 Dave Santoro <dsantoro@google.com> Make all modification operations serialized.

Prior to this change, it was possible for a profile operation and a
contacts operation to both be run simultaneously, since each DB
maintained a separate transaction lock.

With this change, ALL operations start a transaction on the contacts
DB, so modifications to either DB will be serialized. This should
address the root cause of the jumbled mValues bugs, since only one
operation should be executing at any given time.

Bug 5248637

Change-Id: I4cdefddcb7b84f120d009300f45b772f439be88d
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
e72fee30ee40a3c8dd22af43c6257d93bc25b477 01-Sep-2011 Makoto Onuki <omakoto@google.com> Merge "Use new api AbstractCursor.setExtras() to return index info"
720277eff4ffa6344ce2efc1fc39f9ced8af0b6b 31-Aug-2011 Dave Santoro <dsantoro@google.com> Handle profile/contact split for bulk insert.

Unlike applyBatch, in the bulk insert case we have all the info we
need to make a conclusive contacts vs. profile determination, so I
pulled in the logic from the superclass and augmented it to handle
opening and closing contacts/profile DBs and transactions in a
cleaner manner.

I was unable to reproduce Daisuke's bug, but this change would at
least ensure that a database helper is set before attempting to do
an insert in bulk.

Bug 5239086

Change-Id: I8cdbb41c9a8a0f24af99c554942649af1333b627
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
409605a187683155d9c6dbc2626b6419e3dd384e 31-Aug-2011 Makoto Onuki <omakoto@google.com> Use new api AbstractCursor.setExtras() to return index info

Avoid CursorWrapper, which has performance penalty on cross-process queries.

Bug 5220669

Change-Id: I630fffaaaa2b28846c715ae0d2d536da01b701a8
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.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/ContactsProvider2.java
af10329f85c5d8c4196c495a9f0f9a6c6ecbc231 30-Aug-2011 Daniel Lehmann <lehmannd@google.com> Add lookup_key to the StreamItemsView (it was missing in the previous CL)

Bug:5134325
Change-Id: I214f5750a9c445b2bca0cc6a448463c38519bfa1
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
663b8b8ce7a29fb2796dc6431f2cd5992934f315 28-Aug-2011 Makoto Onuki <omakoto@google.com> Add log to measure startup performance

Use this to enable log:

adb shell setprop log.tag.ContactsPerf VERBOSE

Bug 5195464

Change-Id: I8348dffb050c562e708ab81405d556625794fdf3
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
4747809486541f7a3d342d3e1dd48fb5ea255ad6 28-Aug-2011 Flavio Lerda <flerda@google.com> Fix status message in contact updates.

This fixes a problem with a status message being added to a contact's
update stream. The text contains an extra <p> tag, which leads to extra
newlines being rendered.

Bug: 5176548
Change-Id: I28854bf053508e63ac0345556129e82c9e7984cb
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
0fa55000b5c92dd26828178ed4e3d1013c80721a 26-Aug-2011 Makoto Onuki <omakoto@google.com> Merge "Return proper mime-types for stream items"
dac99257ff2cca8028afd471699fbcea44c09a1b 26-Aug-2011 Flavio Lerda <flerda@google.com> Merge "Fixes convertion to HTML of status updates."
d263c073c3697aa3e58a8ef73096b8ff7012f8ea 25-Aug-2011 Daisuke Miyakawa <dmiyakawa@google.com> Merge "Group rows with a same phone number and a contact id."
cf55cbe8932f620484a3634d13ecc116c32fdc99 25-Aug-2011 Daisuke Miyakawa <dmiyakawa@google.com> Group rows with a same phone number and a contact id.

Bug: 5201809
Change-Id: Ie21abb12736715358dd33bc690269f51ae1e0944
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
9b002837367674b7403769f52dc50ab4dbecef71 25-Aug-2011 Daniel Lehmann <lehmannd@google.com> Fix ambiguity for Contacts._ID and RawContacts._ID in Stream Items

Bug:5134325

Change-Id: Id5159a24c9a2aee58e566b9bc03719e7a6ee0f7c
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
fe6c9b5240b1b26a72358dbb80bdda9c3f5c080d 25-Aug-2011 Flavio Lerda <flerda@google.com> Fixes convertion to HTML of status updates.

The code was stripping one extract character. This is only a problem
whem something is appending after it, as in the case of the Updates
header.

Bug: 5212740
Change-Id: I5b82168d83ee41a20256118003bb3d1bce182990
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
518eb86edafbd4d8cd69a9452461baddc2a4aaae 23-Aug-2011 Daniel Lehmann <lehmannd@google.com> Merge "Remove the java-synchronization and completely rely on DB transactions"
af43bfb95070c234ae7090f6041f6fc62366313a 23-Aug-2011 Makoto Onuki <omakoto@google.com> Return proper mime-types for stream items

Bug 5196154
Bug 5198078

Change-Id: I6da42907e900d348294b42d2bc556090c2639ab5
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
fa4db3db4146a26f154ef2e89352ad70a5415b8e 22-Aug-2011 Daniel Lehmann <lehmannd@google.com> Remove the java-synchronization and completely rely on DB transactions

Bug:5134056
Change-Id: Ied50a93fbcd1121ca978cbb8fdcd8556020cb28f
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
e3a10e4fcdb8b5e619f02a26fd1a26cef3b149a3 21-Aug-2011 Flavio Lerda <flerda@google.com> Remove extra new line from status updates.

When status updates are added to the stream items, they need to be
converted to HTML. In the process, an extra new line was added at the
end of each of them.

This commit removed this trailing new line, so that the updates are
shown correctly in the UI.

Bug: 5193689
Change-Id: I223070eeb1439a8ffacbfb61d6e86355b14c68db
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
58567abca253f1efa2db5c39e17e42dca589e916 16-Aug-2011 Daisuke Miyakawa <dmiyakawa@google.com> Use phone number for grouping when normalized number is null

NORMALIZED_NUMBER may become null when the number isn't able to be
parsed by the library (e.g. pager address). Current implementation
groups multiple numbers with null normalized values into one
result, which confuses users.

Bug: 5040732
Change-Id: I1ad7dfb72dbc5d239aa95a913d35c2d8dfe3167c
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
3e6cd1fbafd09bf9b6ec35a19a55b48a271727df 15-Aug-2011 Isaac Katzenelson <isaack@android.com> Fix provider empty state status

Bug: 5074806

The provider was setting the empty state (no account and no contacts)
when the account count was zero and the contacts count was zero.
This is no longer true when you have a profile, so a check was added
to set the status to empty if there is one contact and it is a profile

Change-Id: I9771dc99af1573e5c0ff2ac62ed5e5ca433fd738
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
0bf6b318e3c994294d4a885f57906debd4a0e64e 15-Aug-2011 Daniel Lehmann <lehmannd@google.com> Several DB changes as requested by ES

- Switch from resource ids to names to prevent breakage on package upgrade
Bug:5135277
- Add SYNC1...SYNC4 columns to StreamItems and StreamItemPhotos
Bug:5119385
- Remove ACTION, ACTION_URI from Groups, StreamItems and StreamItemPhotos
(this reduces db size and prevents click intercepting)
Bug:5135808
- Add some raw-contact fields to the StreamItem and StreamItemPhotos query
Bug:5134081

Doing those changes in one block to prevent too many db upgrade steps

Bug:5135277
Change-Id: I1d1661c9a507d9efd4ef334fe21481097e820b7c
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
0e272967c6c6662d8a6eed80650dad0369aac085 13-Aug-2011 Dave Santoro <dsantoro@google.com> Merge "Fix openAssetFile method of inserting photos."
3f9ee8aaba20b358ca63f4b57523c960d82b5cc9 13-Aug-2011 Isaac Katzenelson <isaack@android.com> Fix crash in GoogleVoice when getting contact info

Bug: 5155743 Google voice is in crash loop (stack goes through Contacts)

GoogleVoice is queries for contact data using the PHONE_LOOKUP query.
If the phone number is part of the user's profile, the returned contact
is the profile and further queries (to get the contact's photo) fail
the security check and an exception is thrown.

The fix restrict the PHONE_LOOKUP query to non-profile contacts.
This is a temporary fix until dave's major change for profile
handling is submitted.

Change-Id: I65e42156f1fab5e5cded77f288e3ef69c3f6ecac
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
c6eab5080340824edd2c6676c4e6b96e142f87e4 12-Aug-2011 Dave Santoro <dsantoro@google.com> Fix openAssetFile method of inserting photos.

For reference, the issue was occurring because the file descriptor
passed back to the caller is parceled immediately, which closes the
file descriptor on the provider side before it even gets to the
caller. The solution was to stop fiddling around with temp files
and just pass back a pipe instead - the provider then can simply
read the image content from the pipe and process it.

Bug 5156644

Change-Id: Ie210f65b5b8681524fed12a53df0c852fc951e5a
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
43e6f3b14e00a7bab4876d288d77adfa6787d622 12-Aug-2011 Flavio Lerda <flerda@google.com> Merge "Convert status updates to HTML."
d5ef5903570e533a501abe6a8e3d533fdb5318fc 10-Aug-2011 Flavio Lerda <flerda@google.com> Convert status updates to HTML.

Since stream items text is HTML but status updates are text only,
convert the text to HTML when inserting a status update into the stream
items.

Bug: 5122642
Change-Id: I61e3d9802e527c6977e7d29660ffd137ae899dae
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
9245089f788c01597913b1e998be86a626ae6244 10-Aug-2011 Daisuke Miyakawa <dmiyakawa@google.com> Exclude profile from email filter

Bug: 5131203
Change-Id: I735fc33d00c5d7dde67e3b759365cb8812f69b20
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
cce1c9cf029f40b62955f4b545f94c993daefbd2 04-Aug-2011 Dave Santoro <dsantoro@google.com> Add support for updating profile raw contacts.

Bug 5122027

Change-Id: I4c0c4dc3b8b9eedbca347929fe16893aa1630005
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
3593682b8d9213fde576a0cff54458ad50563980 04-Aug-2011 Dave Santoro <dsantoro@google.com> Fix data set handling for groups.

Bug 5121818

Change-Id: I5bd0c6b0678aed2b708057774d7041b822bf3ed9
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
524913c66ce75ca8dec127ac88e3bc2249c246d9 03-Aug-2011 Dave Santoro <dsantoro@google.com> Fix photo-related tests for Proguard builds.

Bug 5112593

Change-Id: I4b559911a100fdbe466bc79057d22000800e08be
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
a71dc460ca951c7aca591f3f470c160cde70a1e3 01-Aug-2011 Dave Santoro <dsantoro@google.com> Populate data_set in values from the URI.

Change-Id: I332596515fc55d9c28ed7b79128650328112da6c
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
5517770250b3afa4fd88b6869c3244680821d222 29-Jul-2011 Dave Santoro <dsantoro@google.com> Added query instrumentation when verbose logging.

Change-Id: Id55596034b11f819e4f1d367f648be4bb0e73a33
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
03975f7ca8bb2f95ce95b6c694612c2524e91d13 28-Jul-2011 Dave Santoro <dsantoro@google.com> Fix missing column issue with lookup-by-name query

Also fixed a similar problem for undeleting raw contacts.

Bug 5091427

Change-Id: I043eb51eb53676ee9719834456920a9aff4d3e42
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
24bc499d6756e7b2bd95b2eabb64a6d9d13435ba 28-Jul-2011 Dave Santoro <dsantoro@google.com> Initialize PhotoStore in background thread.

Bug 5031708

Change-Id: I6a621ca81281c3a146846f89650779f2a73888cc
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
a4b8d716eae19f2236ecbc13dc3b31ac4d7cd19e 28-Jul-2011 Daisuke Miyakawa <dmiyakawa@google.com> Merge "Return starred with phone number when phone-only"
9dbfd650ccf93714f3266e80f9fbdbcb526ae7b3 28-Jul-2011 Daisuke Miyakawa <dmiyakawa@google.com> Return starred with phone number when phone-only

Bug: 5087645
Change-Id: Ib60353fd44c23566ae0d2cbaa695f5bbdfd26eb0
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
a9828e23ea823db06e5e885d4855ffbc1eba8165 28-Jul-2011 Dave Santoro <dsantoro@google.com> Merge "Provider and DB changes to support data_set field."
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/ContactsProvider2.java
4b64b6e8f448938434cb1e022a4e7dfaae8f9c8c 28-Jul-2011 Makoto Onuki <omakoto@google.com> Query speed up with "raw_contact_is_user_profile" check

Put the raw_contact_is_user_profile after user'selection, not before.

This check is slow but most of the rows would just pass the check, it's better
to do this check after user's selection.

This change will make the group member list query more than twice as fast.

Bug 5087853

Change-Id: I07e7ecb3324601d0c38b5c1aba82d8bdb2501438
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
363bdaba2994539e1a3a2342a9fcf223604d69ea 25-Jul-2011 Daisuke Miyakawa <dmiyakawa@google.com> Make frequent uri work correctly

Also add unit test for it

Bug: 5073384
Change-Id: I7fa41f50883e14a84ef95d2b098379b1d6b47bae
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
f1efadb1255fd75305b59802f736905b9d66e449 23-Jul-2011 Daisuke Miyakawa <dmiyakawa@google.com> Add group count capability and improve performance

- implement group count feature in group summary uri
- improve performance for the uri
-- starting from data table makes SUMMARY_COUNT
SUMMARY_WITH_PHONES quite slow
- add unit test for group summary uri

Must be after Ibc604770cb61ca9fd92280e58f1cd1bbf30c216a

Bug: 5039532
Change-Id: I58fb1040d9025af2e0820a6de85a4eaf2ae30852
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
45ae7eaf0e2c9459ccbeeb5eb5977f055c4ed8ec 21-Jul-2011 Daisuke Miyakawa <dmiyakawa@google.com> Add support for frequent uri

Must be after Ia670229e4d3e793446b0a0dce2590e20709ee18c

Bug: 5050315
Change-Id: I0ad08f65659987aefda20cd1f9fdfb0d375660f0
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
4928b8c8c7a49ec088884cd9d330eeecc811dca9 20-Jul-2011 Daisuke Miyakawa <dmiyakawa@google.com> Make strequent-phone-only returns what we want

- in starred section, just starred persons should be listed.
One person should not appear more than once.
- in freuqent section, we should be able to obtain phone numbers
One person can appear multiple times with different numbers.

To achieve it, we need to tweak results further. Instead of
allowing users to have Contacts columns, we have to allow part of
Data columns (DATA1, DATA2, DATA3). Those Data-columns will be NULL
in the starred section right now.

In order to have those additional columns in Contacts Uri (this is
for Contacts.CONTENT_STREQUENT_URI, not Data), this change has
one restriction: with phone_only flag, users cannot have
IS_USER_PROFILE any more. That's not so critical as phone_only
is not part of public API.

Modify unit test for phone-only results (SMS feedback shouldn't
affect phone-only results). Also introduce comvenient function
for testing feedback stuff in general.

FUTURE TODO:
- We should also be able to obtain a phone number relevant to
the starred person while this change doesn't support it.
- We may need to group numbers by contact instead of showing
them apart (bug: 5059874)

Bug: 5050181
Change-Id: I47f532e5b7bb3f8bfd77215c61abb31a09d7fd51
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
1dfa964f2e1756e27b36f99421bd403c84ea0a5f 20-Jul-2011 Dave Santoro <dsantoro@google.com> Tweak to StreamItemPhotos to include metadata.

This joins in the PhotoFiles table to get width, height, and filesize
info from that table when selecting stream item photos.

It also adds an option to the photo processor to force cropping the
image to a square centered on the original's rect - this is how the
social stream photos are to be displayed in the designs.

Change-Id: I596a4a0be94db0df39d29bc06e1a1684a057a202
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
6802030a777c0c3ba1dc029c534cca4784260632 16-Jul-2011 Dave Santoro <dsantoro@google.com> Forward-compatibility of old status update API.

With this change, inserts or updates to the old status update API
will be mirrored as stream item inserts or updates in the new
social stream API. This is primarily to bootstrap the new stream
data (which is what the UI will be showing) until such time as data
providers start using the new API.

This change also includes migration to using the new photo storage
system for photos from the social stream API.

Change-Id: I0974444077790f706637dd6b9d1f6f50d204aa6c
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
f9648a03e88e2d1a91c616a20d903e4c9a2468e5 18-Jul-2011 Daisuke Miyakawa <dmiyakawa@google.com> Fix malfunctioning bucketization logic

I82052953d5dad42ac171df29248ed25e9b4a2434 dropped the
logic so we need to re-introduce it correctly

As we don't have public API for updating LAST_TIME_USED
columns outside the provider, we need to let the unit test
call a method in ContactsProvider2 directly instead of
calling DataUsageStat API.

- fix the query
- make update logic package-private
- add a unit test for it
- introduce guava to include @VisibleForTesting

Bug: 4998821
Change-Id: I0b699bffffd42a13ab00ac335796687052efb67a
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
87614d7d293b1519dc1f0f403fd59c8bf4d8a347 15-Jul-2011 Dave Santoro <dsantoro@google.com> Photo aggregation logic update.

In the new logic, we'll pick the largest photo (in pixels, using file
size as a tiebreaker for display photos) to determine photo priority
if no super-primary is defined.

If this logic doesn't pick a winner, we fall back to the old photo
priority based on the account.

Change-Id: I9cf58b86a6c22bcf671a4852606a4534fa0fa7da
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
afc8e7ad6e5208db6c87b8500ecc1246ad966d62 15-Jul-2011 Dave Santoro <dsantoro@google.com> Update profile enforcement checks to require a DB.

In most cases, mDb would be set by the time a profile check was first
made, but if the first check is a query, it won't be set. So pass in
the database for initialization on all enforcement calls.

Bug 5032229

Change-Id: I5bde0d9ac54522483a09fb174f22b06a4582b3a5
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
6ae89770d8047852b6a1f6fb3cbac812910aa476 14-Jul-2011 Dave Santoro <dsantoro@google.com> Fix issue with profile checks during updateData().

We were doing a query with profiles included to determine the set of
items to update, but that triggers a permission error if the calling
app doesn't have READ_PROFILE permission (even if the rows being
updated don't affect the profile).

Bug 5028891

Change-Id: Id16d31d5d9d62dea2e62709c6ac03c1562a64438
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
f547fd54d7933e1c03af4a8dc10560c71c38f6b8 27-Jun-2011 Dave Santoro <dsantoro@google.com> Large photo storage.

This change adds support for storing large photos for contacts in the
file system. Large photos passed to the provider will be downscaled
and re-encoded as JPEGs before being stored in the usual data BLOB
field (for the thumbnail) and in the photo store (for the display
photo).

See go/large-photo-design for details.

Change-Id: I26a69ac2ccba631962a3ac5c83edb3f45d7cfc7f
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
1cdfc9dacc136e99d3c0bc5b4212bc3c973be337 12-Jul-2011 Daniel Lehmann <lehmannd@google.com> Allow a sync adapter to provide an OPEN action for a group

Bug:4413120
Change-Id: I798b586acd200f0713c59f75b2815ce22e8a9c86
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
ed6bfd922fd84db21de08c1d12e93c501b86560d 11-Jul-2011 Daniel Lehmann <lehmannd@google.com> Remove restricted white-listing

Bug:4974334
Change-Id: I4dd95089774373d2b67d7e14dc6b7fc40a92d094
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
3b505de6c622d20d40b85b361c1437a89aef82de 08-Jul-2011 Daniel Lehmann <lehmannd@google.com> Provider implementation of stream item API.

The following URIs are supported:
contacts/#/stream_items (query stream items by contact ID)
contacts/lookup/*/stream_items (query stream items by lookup key)
contacts/lookup/*/#/stream_items (query stream items by both)
raw_contacts/#/stream_items (query/insert stream items by raw contact ID)
stream_items (query/insert/update/delete stream items)
stream_items/photo (query/insert/update stream items)
stream_items/# (query/update/delete stream items by ID)
stream_items/#/photo (query/insert/delete stream item photos)
stream_items/#/photo/# (query/update/delete stream item photos by IDs)
stream_items_limit (query limits for stream items and photos)

Change-Id: Ice433c53e18087e5e6295ad9a112062d44b12dd2
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
7d7d0e95636344c01eb4e4d034791c199bee98e9 28-Jun-2011 Daisuke Miyakawa <dmiyakawa@google.com> use System.arraycopy

Change-Id: I8f9525659ce5bead62f3693f79ce70771d87e384
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
2f830d3bb66f780937203e9738e046841a070e73 25-Jun-2011 Daisuke Miyakawa <dmiyakawa@google.com> Use new data usage stat for strequent contacts

Must be with Ie193bb91ee49b18f4a546a1f52be780bb514301d

- use phone-only query parameter in strequent mode
- introduce data_usage_stat View for combining the table
with some of data/raw_contacts columns, which are needed
for strequent uris.
- modify strequent impl for supporting phone-only search
- modify a test for strequent uri handling

Checked performance. We need UNION ALL there and some nasty
hacks with two sub queries.

Bug: 4371572
Change-Id: I8c81747d8a8ae47ce551067fc4dbe2c48f4f48ae
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
377850d2dfd28eaf1b22273a50cfe066f6667ab9 24-Jun-2011 Dave Santoro <dsantoro@google.com> Renamed INCLUDE_PROFILE param to ALLOW_PROFILE.

Bug: 4777097

Change-Id: Ib254569f2595ae90e5ef72c1c4abcc7a5e45215b
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
fdd04bc3a972cd72dfe7bf925e1624d656b34cf7 21-Jun-2011 Martijn Coenen <maco@google.com> Implement openAssetFile() for profile vcard.

Also passes the query Uri directly to the vcard composer
for the different vcard modes.

Change-Id: Ie562e92b3ce54092b8a0cdf87db55b612768573b
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
c591cc2ffecdd0038f787a133606752752294c13 18-Jun-2011 Daisuke Miyakawa <dmiyakawa@google.com> Prefer primary data to others.

Bug: 4723377
Change-Id: Iaeb74924a8567d049adcd91dfa03814a63abf088
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
71340347b4862d4b1368a5d69d1667e2245952e4 17-Jun-2011 Daisuke Miyakawa <dmiyakawa@google.com> Fix test breakage introduced in ICU upgrade.

- Move HanziToPinyin.java to ContactsProvider package.
- Update tables in the file.

HanziToPinyin.java (in framework) has had collation table for
effectively searching Pinyin-s for Chinese Hanzi-s. The table
is based on previous ICU (4.4, or before).

With I695558055cc139b42b71da9138f61d19bcbd9758, ICU 4.6 is now
available, which has tons of improvements in zh collation, while
HanziToPinyin.java still has a table based on previous ICU. This
caused several test breakages and caused a real problem in Chinese
name sorting.

Also HanziToPinyin.java is only used by ContactsProvider, so there's
no strong reason for us to have it in framework (even though hidden).
It would rather convenient to have it in the provider package to
track issues around the file.

Bug: 4645142
Change-Id: If786dd286dab47ca1b2ccab38c5fa43ae390c0f7
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
2262f0ccc800b93a9d1e63c55654ca3aaf5e7d1c 15-Jun-2011 Daisuke Miyakawa <dmiyakawa@google.com> Prioritize IN_VISIBLE_GROUP in auto-complete.

Previously it was ok to show data not in any group, as
we had just shown display_name and email addresses.

Now with chips we show photos, while a lot of data not in any group
usually don't have photos.

Bug: 4371572
Change-Id: I501ddba5d26302ab734ead783a5ddbf36a581010
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
dfa6d58328345c7c91f2467d29189a57b96bfe2a 15-Jun-2011 Martijn Coenen <maco@google.com> Support for streaming vcards without photo.

Change-Id: I4c119156584f2290c2081412b206351274230fd4
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
46abbb56764add30cb6e6506f55d8dededc88113 07-Jun-2011 Daisuke Miyakawa <dmiyakawa@google.com> Introduce data usage table for per-method ranking.

- have a hidden table for per-method promotion
- make filter API use it (phone, email only)
- add a unit test
- remove an old test using previous API

Must be after: I602c0b83afca674904946f59bbdfc4dca07d46e4

Bug: 4371572
Change-Id: I82052953d5dad42ac171df29248ed25e9b4a2434
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
24c1d384b45a6d3c1cc959062a9d4308335fabbf 28-May-2011 Dave Santoro <dsantoro@google.com> URIs and queries to support profiles.

This change includes:
- A database upgrade to support tracking whether a contact represents the
user's profile (represented as an optional raw contact ID specified
per-account, and looked up in the various views).
- New Contact Provider URIs for retrieving profile-specific data:
- profile: To retrieve the user's profile contact.
- profile/data: To retrieve data for the user's profile contact.
- profile/data/#: To retrieve data for a specific data entry for the user's
profile entry, by data ID.
- profile/entities: To select entities for the user's profile.
- profile/as_vcard: To retrieve the profile as a VCard.
- profile/raw_contacts: To retrieve or insert raw contacts for the user's
profile.
- profile/raw_contacts/#: To retrieve a specific raw contact entry for the
user's profile, by raw contact ID.
- profile/raw_contacts/#/data: To retrieve data for a specific raw contact
entry for the user's profile, by raw contact ID.
- profile/raw_contacts/#/entity: To retrieve raw contact entities for a
specific raw contact entry for the user's profile, by raw contact ID.
- Permission checks to ensure that any access to profile data (whether
explicitly through the above URIs or directly via ID) enforces READ_PROFILE
or WRITE_PROFILE access.
- New and updated tests (including permission check cases for all of the above,
plus query checks for each).

I've also had to move a few large tests to medium to work around
b/3329504. I've also removed the database close step from contacts provider
test teardowns, as it doesn't seem to be necessary, and results in almost a 3x
performance boost on test runs.

Change-Id: I220552c26ad1eb3fbf24fdd865df2fe59fe4a688
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
09e69522745551522c55dff27424496f255def46 02-Jun-2011 Daniel Lehmann <lehmannd@google.com> Enable selection strict mode and sql injection tests

Bug:4368912
Change-Id: I3f854a54e402f366be9bc6712a6188b4537b990b
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
5fdc17bae46504edebe7285c3dbc7691ef3fbeb9 07-Apr-2011 Daisuke Miyakawa <dmiyakawa@google.com> Fix wrong handling in getQueryParameter()

ContactsProvider2#getQueryParameter() wrongly
interprets long parameter name as shorter one which is
substring of the original.
(e.g. "longer_param=value" is also treated as "param=value")

Bug: 4260119
Change-Id: Ide096589106984a5d99e70f754830d7943a7ac5c
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
547c5eddcc79f680dc128b3851bf6cc03b0d0ebf 05-May-2011 Dave Santoro <dsantoro@google.com> Fix issues with Contacts sync.

We were wrapping cursors on Contacts queries too aggressively - the only cases
we should be wrapping with a snippetizing cursor are when the query actually
contains a snippet column.

Bug: 4382294
Bug: 4378350
Change-Id: I0bd007afde0bb850e88f5953f5efcfddbda0e2e4
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
3716f1447ceb21180d1301790eabd8b9453f486d 27-Apr-2011 Dave Santoro <dsantoro@google.com> Move snippet logic from DB to a cursor wrapper.

This results in a huge performance boost when doing searches and filters across
large Contacts DBs, since the expensive snippet() function (and associated
joins necessary for its logic) no longer need to be run for each record
returned; instead, the snippetization is only done as each entry is retrieved
from the cursor.

If the query string entered by the user consists of multiple tokens, the DB
snippet() function will still be used.

Bug: 4021462

Change-Id: I60ce69b4506bc7f770f139c127f859689b05f2d3
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
04f7fc0bddad198108d2f45cb730b9506e81dedb 26-Apr-2011 Daniel Lehmann <lehmannd@google.com> Rewrite subquery to make better use of indexes

Bug:4021462

Change-Id: If14d2c6b2e3a57c27bf16387295d45d23df52465
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
7d82ae92714f2132e3a0971d844ae8cdf10d76e7 05-Apr-2011 Daisuke Miyakawa <dmiyakawa@google.com> Add "primary account" support.

Two query params "PRIMARY_ACCOUNT_NAME" and
"PRIMARY_ACCOUNT_TYPE" allow users to supply
a primary account associated with the query, which
enables contacts provider to optimize query results.

For example, in an email composition screen, users may
want to promote email addresses related to an account
selected as a "from" field. This change allows the
client to let the contacts provider know the account.

Must be with I2a22be56822226e3ea6b6f2ef23bb77816d0345a

Bug: 3510087
Change-Id: Ibce363d336cb3e3a1fca10bddbd912ec96e4b059
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
108f1be6b0e855f1b335bc591755a9e5f488175a 17-Mar-2011 Daisuke Miyakawa <dmiyakawa@google.com> Use new interface for vCard export

Bug: 4066223
Change-Id: Ie21c8966b0bb5b73b3afd18bfe7c142b523413c4
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
7df711d8b184abb8ec97516de2553c470264293f 10-Mar-2011 Daisuke Miyakawa <dmiyakawa@google.com> Use old version of vCard composition method

Must be after I91b65f881e1712ecf82c2e119a92bc70c43c623c

Bug: 4066223
Change-Id: I2667a91d90b1ce985a354a5a37de75bb8156cff8
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
8ab0b7a48efe540226253567bcf6fdbc487186a2 25-Feb-2011 Dmitri Plotnikov <dplotnikov@google.com> Moving updateRawContactDisplayName from aggregator to dbhelper

This is done in preparation for a fix of

Bug: 3488074
Change-Id: I0456a6925a76a4974d7a76ab4dce326f5637d871
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
2352cf62c46e1caaad64c7b3dbcc601951018eb3 12-Feb-2011 Dmitri Plotnikov <dplotnikov@google.com> Masking the 'malformed MATCH expression' error

This is a temporary fix.

Bug: 3445187
Change-Id: Ib7325c8a3977ab9a17173aefe5a70abab7160540
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
155accbcb95fc13b984cf0ea8e5498a9c619cbf5 12-Feb-2011 Dmitri Plotnikov <dplotnikov@google.com> Full text search: email suggestions

Also, removing a bunch of dead code

Bug: 2078420
Change-Id: I2c0a9ddd8e60624049b39ac018f87bfabc6574c2
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
92ddc5cdc4d89ee2c6e861ae7b3a3a913ffa0100 12-Feb-2011 Dmitri Plotnikov <dplotnikov@google.com> Full text search: Asian language support

Bug: 2078420
Change-Id: I1a99ad05bb6e30b539134d60f669134b87dbf180
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
174f7d319b987aa2aeeb6f2563f4b939acb8d791 11-Feb-2011 Dmitri Plotnikov <dplotnikov@google.com> Full text search: QSB support

Bug: 2078420
Change-Id: I767ccecc856c0ae9ad74aafb3dac0de39b657e3c
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
30cc766756461da8d53933f88ea01dd2272a90eb 11-Feb-2011 Dmitri Plotnikov <dplotnikov@google.com> Full text search: minor bug fixes and test clean-up.

Please note that at this stage QSB cannot search by
organization - that index has been removed. Thus
a couple of tests will be failing until QSB support
is restored.

Bug: 2078420
Change-Id: Icb5d4636b18c3fa3e26eca4ed386492cb28db62d
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
7ba290f5de7f116ec0eaac30980ffef2878d2b64 11-Feb-2011 Dmitri Plotnikov <dplotnikov@google.com> Full text search: optimizing index use

Bug: 2078420
Change-Id: Ibf4ebdd03934d68402d123bb39c6a061c609e3e9
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
197411a6cc3f81b94a34ca207f267d43d8548f04 10-Feb-2011 Dmitri Plotnikov <dplotnikov@google.com> Full text search: removing organization from name lookup

It no longer needs to be in the name lookup table,
because we now have it in the search index and we
don't use it for aggregation.

Bug: 2078420
Change-Id: Iaab128513ff29a38f97c7d880c2aae668a3ef865
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
bd9abbb6b03b4ec1e28ad3fa2fcba5d1eb8609ea 10-Feb-2011 Dmitri Plotnikov <dplotnikov@google.com> Full text search: updating search index on change of visibility

When a contact becomes invisible, the search index will
be cleared. When it becomes visible, the index will be
built.

Bug: 2078420
Change-Id: I1eea88d3d9babc891d112d15d9041d01c383f22f
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
f482a4e25759d2c144eb41a3de56a342bd473435 10-Feb-2011 Dmitri Plotnikov <dplotnikov@google.com> Full text search: no snippet when searching by name

Bug: 2078420
Change-Id: Icdd38c9963accec117ce134ef5a13e08e5f07f05
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
3d0f0e0a1325ae306842b3ad1487d3507df0821d 10-Feb-2011 Dmitri Plotnikov <dplotnikov@google.com> Full text search: special snippet for phone number search

Bug: 2078420
Change-Id: I0771c46b516009df7d11471dfee87fac5a2925bf
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
5e70c0772ef2b975c95787112ac0f15047a4ff0c 10-Feb-2011 Dmitri Plotnikov <dplotnikov@google.com> Full text search: special snippet for email address search

Bug: 2078420
Change-Id: Ic8f49e91fbc039ce1f167bf58c8393019102b71a
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
03197a00e17386aa9b1971bde3cda034bc17e0c3 09-Feb-2011 Dmitri Plotnikov <dplotnikov@google.com> Full text search: updating filtering logic

This is half-done for now. A bunch of code is still protected
by if (false).

Tests temporarily do not run.

Bug: 2078420
Change-Id: Ie9b5a286426557c85c235413176090915bd6d9c2
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
05e50fbf9809bf04eceec3d2a2753630dc4f9315 09-Feb-2011 Dmitri Plotnikov <dplotnikov@google.com> Full text search: building full index for all contacts

Bug: 2078420
Change-Id: Ief6db4f4ecc0b6e5adb37a0654a72383099dc138
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
6d9702cec82fd27a1c3093c64df9dcc22744899a 09-Feb-2011 Dmitri Plotnikov <dplotnikov@google.com> Full text search: adding remaining built-in data types

Bug: 2078420
Change-Id: Ifbd67f5ed65c44c2521a4b4d48d90aab8d0c86d1
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
f262d56495ac4ea30d31bd050efb116bd4bb4235 08-Feb-2011 Dmitri Plotnikov <dplotnikov@google.com> Full text search: adding internal provider API.

Also, adding the very first data type to FTS: organization.


Bug: 2078420
Change-Id: I64d6f6a63efc838c4c2c80d4311bcc23bae23a67
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
6ca827312e6c69bdd88b48e485debee9fe5d16ba 05-Feb-2011 Dmitri Plotnikov <dplotnikov@google.com> Fixing inappropriate use of implementation detail

Bug: 3426389
Change-Id: I67051b37ab73abff7201ec3e0e7a25425e91d1ad
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
7b330a64cdf77ddb1c3e7259a7f069e99b025b51 25-Jan-2011 Dmitri Plotnikov <dplotnikov@google.com> Fixing NPE during bulk insert in ContactsProvider2

If the first bulk insert is received before the provider
is fully initialized, you get this NPE. The provider
needs to wait for write access before doing the insert.

Bug: 3385546
Change-Id: I58b14c1824d738ef4dd1447dbf11fa678aa8f5a5
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
9a6be1610fdf40c2f7f04cfe4b66fde3a35940dc 20-Jan-2011 Dmitri Plotnikov <dplotnikov@google.com> Making QSB query not return "Dial 777" when on a no-telephony device

Also, adding support for QSB search by phone number and
email address.

Bug: 3349545
Change-Id: Ib30cc05f1894a0a74c5dcd349affb367d82603fd
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
50a7c86b4b49870bd19d5270722be3f1fccaf226 18-Jan-2011 Dmitri Plotnikov <dplotnikov@google.com> Fixing bad SQL in search.

When the filter is "(@" the provider treats it as an email
address, but it actually is not, so the resulting SQL
has the "WHERE" keyword, but no selection whatsoever.

Bug: 3364240
Change-Id: Ie06ecc27209148253f65fe4f3bd6b3d5c96a7707
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
5f1f4a062ac34d75d2dbf586702cbeb121cf09ca 14-Jan-2011 Dmitri Plotnikov <dplotnikov@google.com> Removing legacy compatibility with the notion of a "hosted account"

Bug: 3349346
Change-Id: Ib33f9697142a2419f29d5a43d8276504f42cbcc8
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
038893e70e8f7d0beafbb26c47586bc05191f1ce 13-Jan-2011 Dmitri Plotnikov <dplotnikov@google.com> Preventing dialable letters from matching phone numbers

In simple contact search that mixes search by name
as well as email and phone number, it is incorrect
to match "ABCDEF" to phone number "222333". We only
want to use the phone number matching if the filter
looks like a dialable phone number.

Change-Id: Ida7a12ba815a4127b482452fe11d5ac7b784f363
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
a1e177389debb74a51587720464a527a193bffc1 13-Jan-2011 Dmitri Plotnikov <dplotnikov@google.com> Adding support for contact search by email address and phone number

Bug: 3344700

Change-Id: I832b24bd312d4ce89b1a33678081ad4fc0f74755
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
415ba9ec45dc1be35d3921b28e1dae23e150fb25 11-Jan-2011 Dmitri Plotnikov <dplotnikov@google.com> Fixing crash in ContactProvider2.getType when accessed too early

Unlike query() and other methods, getType() did not wait
for the provider to get initialized and would raise an NPE
during booting of the device.

Same would apply to the openAssetFile method, though it was
not actually called during boot time.

Change-Id: I502554b28ea908ff87c018c9330d6b55b1ac52bf
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
e2adda196b19047bc5243d2bffe9e5650e17e39d 05-Jan-2011 Dmitri Plotnikov <dplotnikov@google.com> Making address book cursor cross-process

Bug: 3324678
Change-Id: Ic071fa034d8926930e70807b1b45b696446e58df
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
d9ec58265ae59a549880ef63cdfb5d0d977cdaba 04-Jan-2011 Dmitri Plotnikov <dplotnikov@google.com> Moving SQLiteContentProvider to /common/ex

Change-Id: I482f3d54041efef6348f53f06abfac3d21e0f28a
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
fd2a6a5b7ecbbec6298182daee3b252896f82ea4 23-Dec-2010 Dmitri Plotnikov <dplotnikov@google.com> Fixing a database contention during locale change

Bug: 3304345

Change-Id: I4b89d15d067df83b24a760fe1dd67605d2ad2f28
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
15c6e903b6d66e20e7cb1ebe7ff8c713e0a3386b 08-Dec-2010 Dmitri Plotnikov <dplotnikov@google.com> Fixing strict mode violation in ContactsProvider2.

Bug: 3250314
Change-Id: Iab0f1bf98132260bb51e99613572f0db5044095b
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
ed78fd6df5e9f3a2d572162e5d374d1f4a625bdd 03-Dec-2010 Dmitri Plotnikov <dplotnikov@google.com> Fixing broken tests (proguard issue)

Bug: 3244266
Change-Id: Id64d6609a3223ada664e87f134e368c429b4fde6
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
bf732767b4d4d7104e4723bda7d3b0eb0f909997 02-Dec-2010 Dmitri Plotnikov <dplotnikov@google.com> Moving initialization and callbacks to background

Bug: 3228684
Change-Id: I7fab53092dbf55ebb502bc5d4d2012c88842c8b8
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
ed089fd34d7b3baf29709eb4f2bc14fa35117660 01-Dec-2010 Dmitri Plotnikov <dplotnikov@google.com> Fixing broken build

Change-Id: I3761b94f2801e005babd70f02ca5852a4c0d5d9f
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
f6d4922f664127d0455b45b1f7444c4553581282 01-Dec-2010 Dmitri Plotnikov <dplotnikov@google.com> Extracting DataRowHandler classes to the top level

Change-Id: Ica84da28a01a9c1b3c19967ab8cb154d796812c2
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
5df7e46835c4f103b05407660b4769edd515760f 01-Dec-2010 Dmitri Plotnikov <dplotnikov@google.com> Making StructuredNameDataRowHandlers a static inner class

Last step before turning them into top-level classes (really)

Change-Id: Idc84327ed75bd8a30ab3a8f1934860b6473d4a53
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
e8b3427e88d28a00cdcad7d296544f2459dfc629 01-Dec-2010 Dmitri Plotnikov <dplotnikov@google.com> Making DataRowHandlers static inner classes

Last step before turning them into top-level classes.

Change-Id: I6d42d591682eb24ab9ec4d0575106ca9d5016865
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
7e2635fa663312adb2bc9d04f50a6bb54c6cc5f4 01-Dec-2010 Dmitri Plotnikov <dplotnikov@google.com> Moving a method from ContactsProvider to ContactAggregator

This is another step in preparation for turining
DataRowHandlers into top-level classes.

Change-Id: I74611a64e4601fdbbcc4fa99521026f0c95e3d2f
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
d364d74ce9cc677c10362b8686d7c33fafe78beb 01-Dec-2010 Dmitri Plotnikov <dplotnikov@google.com> Introducing a TransactionContext object to hold state for a single TX

This is another step in preparation for turining
DataRowHandlers into top-level classes.

Change-Id: I43cfad5cebcebd5e3c51000d1732e778f400d238
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
2a8fefb86282c06a7669f80e1b2b86d87619dfc2 01-Dec-2010 Dmitri Plotnikov <dplotnikov@google.com> Running tests against an in-memory database.

The reduces the total run time for the test suite
from about 600sec to 90sec.

Change-Id: I68b5c17f1710ab7415913f256c925beead4dd825
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
189273b8a9ae75d88690febfbed2d635138799ec 01-Dec-2010 Dmitri Plotnikov <dplotnikov@google.com> Moving more logic into ContactDatabaseHelper

This is in preparation for making DataRowHandlers
top-level classes

Change-Id: I861aa3ea5cde977283641317222b6b3d48282d98
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
49d48c0a709c1efa8593acadadd31350bfc75d9a 01-Dec-2010 Dmitri Plotnikov <dplotnikov@google.com> Ensuring that cached db connection is only used in transactions

The mDb field should not be used outside transactions,
because the database may have been closed between transactions.

Also, fixing a race condition described in

Bug: 3106464

Change-Id: I002a107f3b8aafa1a58dfdab2980978b00fc5ec1
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
78fb53bfd973760996fe3a5fe260b1d367574de6 30-Nov-2010 Dmitri Plotnikov <dplotnikov@google.com> Switching to lazy SQL compilation.

Compiled statements are now created as needed.
This will help with two issues:
1. slow startup performance
2. inability to close and reopen database w/o a restart

Change-Id: I1ec13994979caa92b7d4edc12046b4be0f989ba3
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
89b7c2b6e0003b17d08002f02d6aeec9f9788c8d 30-Nov-2010 Dmitri Plotnikov <dplotnikov@google.com> Fixing LegacyContactImporterTest

Bug: 3240203
Change-Id: Ib733141a31c648437fa5d7171e0bfd22a4911c0f
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
6dd371aea88e09cbe56b8c483021f3bf61527331 24-Nov-2010 Daniel Lehmann <lehmannd@google.com> Allow zeroing the primary/super-primary flag

Bug:3212270

Change-Id: Iee664d6a13f66f0f38ed5829488e42b57448dad4
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
c039cfb78c40730483fd71178df63ada5826a315 20-Nov-2010 Dmitri Plotnikov <dplotnikov@google.com> Adding support for the new column: Groups.GROUP_IS_READ_ONLY

Change-Id: I9dc91a03d7732544cedf439e0c940c035cbfdb39
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
3826a44d8de41e9c148dd6a967392ea5af478085 18-Nov-2010 Dmitri Plotnikov <dplotnikov@google.com> Adding support for a new ProviderStatus

Change-Id: I76da184b794ea7727b9109e693fbf8834c9450b6
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
6b759a2b977a29c3c4abe1eb6d2ba242f937a923 12-Nov-2010 Dmitri Plotnikov <dplotnikov@google.com> Excluding non-alphanumeric chars from contact search

Bug: 3172506
Change-Id: I3811b01e8893e4e292671fc2ac4a43771e7505e9
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
f4015ab9ab7c26b766b5331fbf6655b8c54877ea 11-Nov-2010 Dmitri Plotnikov <dplotnikov@google.com> Fixing an issue with social status updates after a contact split

Bug: 3172848

Change-Id: Iea102c2751d48f6d0f0d78474ad664a24dc46602
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
a85745ab25f9ab8fd6fd29e174bf2fac5492e448 03-Nov-2010 Dmitri Plotnikov <dplotnikov@google.com> Printing an error message instead of throwing an exception.

When we get a query containing an invalid directory,
just return null. This could be a stale URI, shortcut
etc. No reason to blow up the client app.

Bug: 3119769
Change-Id: Ic798b59341a3dec360e62eb9b43671f17e483169
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
23061012b777c607100ce30250c3542b4fc8c1c8 02-Nov-2010 Dmitri Plotnikov <dplotnikov@google.com> Fixing QSB contact search that includes special chars

Bug: 3141773
Change-Id: I16fdb41baa8d3cde5aa38333c551916ba7bfc7a4
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
f87d3f35a3759d5b95a403c2539859e1b3ee429f 02-Nov-2010 Bjorn Bringert <bringert@android.com> Include length in vcard file descriptors

Bug: 3042385
Change-Id: I01d023e9e9777d4ced3add931faea59fcba6a934
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
08ee3fb4e82900b52d02627ed54907431f4f5ade 27-Oct-2010 Mathew Inwood <mathewi@google.com> Throw FileNotFoundException when contact photo not found.

Bug: 3065064
Change-Id: I209ead53eae1e3e44fb6e3298885f66b9aca455b
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
1dac83b8fa58944acfd00f44e717a7dddc659d2d 14-Oct-2010 Dmitri Plotnikov <dplotnikov@google.com> Fixing crash when email lookup query is missing an email

Bug: 3061109
Change-Id: If1030c7c4a825b137f745823dcd88bea6cf7ac42
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
d98a2d76849bcdec668e6a639f5b738edffd0e27 13-Oct-2010 Dmitri Plotnikov <dplotnikov@google.com> Merge commit '0dce6bf7a' into manualmerge

Conflicts:
src/com/android/providers/contacts/ContactsProvider2.java

Change-Id: I9f62ee8ba755224f4fef8fb9354c4e68969971a5
e34b6c291ea04cb88ff124455b6b1943e04d425c 13-Oct-2010 Dmitri Plotnikov <dplotnikov@google.com> Merge commit '8638e1e9' into manualmerge

Conflicts:
src/com/android/providers/contacts/ContactsProvider2.java

Change-Id: I2585cef1f1ae37b8ed028b8e58b8b5b431f460c6
53214b3ed12b0ff9cb589b6559311f2ac142f2e3 08-Oct-2010 Bjorn Bringert <bringert@android.com> Move SyncStateContentProviderHelper to frameworks/ex

Change-Id: Ib776d018678120e962ca1e28f5d14ea7d3b23471
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
2f3dea5e7ad22182915c5576b561622496afa574 12-Oct-2010 Dmitri Plotnikov <dplotnikov@google.com> Merge commit '2a0d5f9c' into manualmerge

Conflicts:
src/com/android/providers/contacts/ContactsProvider2.java

Change-Id: I809b6ac511c43d6e60cb749b7811786e7ec08bdb
0dce6bf7a86a78d3073327419f17395c3a2d2688 12-Oct-2010 Dmitri Plotnikov <dplotnikov@google.com> Changing contact aggregation to not join from same account

Second attempt, now w/o an infinite loop.

The change addresses several requirements:

1. If "Michelle Lee" and "Michelle Lee" are two contacts
in the same account, we won't aggregate them.
2. If "Michelle Lee" and "Michelle Lee" are two contacts
from different accounts, they do get aggregated, but
if a third "Michelle Lee" shows up in one of those two
accounts - we bust the original aggregate.
3. If "Michelle Lee" and "Michelle Lee" are not aggregated
and a third "Michelle Lee shows up, it does not get
aggregated with either of the first two regardless of
the account.
4. Any manual joining overrides the above behavior.
5. The OTA with this change will bust all aggregates that
contain raw contacts from the same account.

Bug: 2650610
Change-Id: I413231af4cfa620f8d266a758c22bfc879aeae07
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
8638e1e999596ddfe12cbb529e58ca2345185af4 11-Oct-2010 Dmitri Plotnikov <dplotnikov@google.com> Revert "Changing contact aggregation to not join from same account"

This reverts commit 2a0d5f9c628e723261bc5198e0fd606076b76b74.

Bug: 3086301

Change-Id: I7f05eb14122687950ca7d22d591fc172c463045e
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
2a0d5f9c628e723261bc5198e0fd606076b76b74 11-Oct-2010 Dmitri Plotnikov <dplotnikov@google.com> Changing contact aggregation to not join from same account

The change addresses several requirements:

1. If "Michelle Lee" and "Michelle Lee" are two contacts
in the same account, we won't aggregate them.
2. If "Michelle Lee" and "Michelle Lee" are two contacts
from different accounts, they do get aggregated, but
if a third "Michelle Lee" shows up in one of those two
accounts - we bust the original aggregate.
3. If "Michelle Lee" and "Michelle Lee" are not aggregated
and a third "Michelle Lee shows up, it does not get
aggregated with either of the first two regardless of
the account.
4. Any manual joining overrides the above behavior.
5. The OTA with this change will bust all aggregates that
contain raw contacts from the same account.

Bug: 2650610

Change-Id: Idfba4dd330a4842310f3fed85e6ae0a3a634e95c
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
90f51664389e302cd3d498e8fcef04ec26f28de5 30-Sep-2010 David Brown <dab@google.com> am f481f22a: Handle DATA in ContactsProvider2.getType().

Merge commit 'f481f22a9323fe338672f99b88b26c5f0725cd42'

* commit 'f481f22a9323fe338672f99b88b26c5f0725cd42':
Handle DATA in ContactsProvider2.getType().
f481f22a9323fe338672f99b88b26c5f0725cd42 29-Sep-2010 David Brown <dab@google.com> Handle DATA in ContactsProvider2.getType().

(I noticed this was missing because I saw IllegalArgumentExceptions in the
logs when doing caller-id lookups for SIP addresses, which happen directly
on the Data table.)

It is valid to call getType on a DATA uri, though, so we now return
Data.CONTENT_TYPE.

Bug: 3004127
Change-Id: I14538cd8671e2f47acedddd79c18bd2ce4709a8f
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
778d92d4dce5f76c649e2aca9d00d3f214cd7643 23-Sep-2010 Dmitri Plotnikov <dplotnikov@google.com> Adding PHOTO_SUPPORT and SHORTCUT_SUPPORT to projection maps

Change-Id: I268debfdfaa635b7564cfa67a98e71800575d367
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
3d67ff829e8acb0f650f155c3c0d377c0f46507a 23-Sep-2010 Dmitri Plotnikov <dplotnikov@google.com> Adding support for PHOTO_URI and PHOTO_THUMBNAIL_URI

Change-Id: I080c3227164eba6804095a4f0cbd82bb5093e161
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
385182830ff0ed84edce9aba2424d2afe99453ce 22-Sep-2010 Dmitri Plotnikov <dplotnikov@google.com> Adding a table for Directories.DEFAULT contents

Change-Id: I9d1c15e6df24fbec84e436923abdae75b88c6eac
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
d015a8321fb9dcbfa96becb909145dfcce3da608 20-Sep-2010 Bai Tao <michaelbai@google.com> Fix the failed unit test

Change-Id: I27a7918608ed854c8ed9108a9d2d4d5fc5b24ec8
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
f4e7ae68ba58d82b16bc2101db8d0f358c1d9297 15-Sep-2010 Dmitri Plotnikov <dplotnikov@google.com> Making "distinct" applied automatically for Data queries

The code ensures that "distinct" is NOT applied
when projection contains columns unique to the Data
projection map (as compared to the Distinct Data
projection map).

Change-Id: I87f8492357be92c4105d15deca3bb9a3eb07edae
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
cf832869bcf91b8037d8b7f510a3a213b30764a3 14-Sep-2010 Dmitri Plotnikov <dplotnikov@google.com> Adding a missing column to projections

Also fixing a couple of broken tests.

Change-Id: I7e2fef3fd421fe0f6a47a39bbb5b44efb9399b69
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
1b2a89588e9593756c2627ce1683539f4ffa1e51 11-Sep-2010 Dmitri Plotnikov <dplotnikov@google.com> Fixing the rescan of packages for contact directories

Change-Id: Ic2eb69595b0bd439d1cd4a000eb509eee9be06b3
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
afb84050536a4472c13efc0e996d31132d254605 10-Sep-2010 Dmitri Plotnikov <dplotnikov@google.com> Fixing NPE in ContactsProvider initialization.

Change-Id: I062db8216ab8336ec3a0e6166eef26730c01766f
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
66e3c421a517bf704a6e2ccf8c47c65ae2fc677d 01-Sep-2010 Dmitri Plotnikov <dplotnikov@google.com> Reverting CL I3ec109a9

Change-Id: I5fed8b5fdfae1dbebeb53a376456705a6f0f8df9
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
6255d756615cfa89fb3411d1840dbe08e1375ffe 01-Sep-2010 Dmitri Plotnikov <dplotnikov@google.com> Rescanning all packages for directory providers

Now automatically scanning all packages to see
if they come with directory providers whenever
an account is added/changed.

Change-Id: I1ec1851f923aeba47c4c3dc751534c562885f0f0
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
c918b0d3ab17a45a392748f43956b927c83eb402 01-Sep-2010 Dmitri Plotnikov <dplotnikov@google.com> Improved ordering of email address autocomplete suggestions

Change-Id: Id59c2f40400eb7b3394ea6774ce48036859ecc86
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
2530512f639c4979fd7371c7dd25dd67e8118124 26-Aug-2010 Bai Tao <michaelbai@google.com> Store the current country code in call log

a. Created a CountryMonitor class to monitor country for CallLog and Contacts Provider
b. Added a new field countryiso in calls table.
c. Upgrade the database to 406.

Change-Id: I894739c65672b017f8d634f0d9cd5dd11ac930d1
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
2e40e351a80ff608045bc9f55b48bd1a3d16926b 01-Sep-2010 Dmitri Plotnikov <dplotnikov@google.com> Passing the "limit" parameter to directory providers

Change-Id: Iad41e6a63c69d4f8a00b14f99e8d425a8cff1947
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
6206cd7e15b1fe63b72cc9ba32a4d84c764963ce 31-Aug-2010 Dmitri Plotnikov <dplotnikov@google.com> Temporary patch to allow people to sync contacts

The contact sync crashes

Bug: 2965003
Change-Id: I3ec109a9de7ed227d9d702ccbe327a26d25c7c4e
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
3d83de8caa2a62925e242f32ccfdd3f5179b16f1 31-Aug-2010 Brad Fitzpatrick <bradfitz@android.com> am 9516b6ee: Use new SharedPreferences.apply() instead of commit().

Merge commit '9516b6eef76b3504913f5efcadf603969946a3d0'

* commit '9516b6eef76b3504913f5efcadf603969946a3d0':
Use new SharedPreferences$Editor.apply() instead of commit().
9516b6eef76b3504913f5efcadf603969946a3d0 27-Aug-2010 Brad Fitzpatrick <bradfitz@android.com> Use new SharedPreferences$Editor.apply() instead of commit().

apply() starts an async disk write and doesn't have a return value but
is otherwise identical in observable effects.

Change-Id: Icd6065e9ef650f80a93e1397bfd6300edc2670c0
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
332321f2832d52f50b9f8fc1f4006459000a4b21 26-Aug-2010 Dmitri Plotnikov <dplotnikov@google.com> Unwrapping transitive cursors.

When we get a cursor from a Directory it will likely
be wrapped into a CursorWrapper. CursorWrappers are
not CrossProcessCursors and cannot be returned over
the binder, so we need to unwrap them.

Change-Id: I2148d0cf72d8cce299019f3d24b8f4e269a762a3
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
4458d63ef3384832fd2ad82130d4ad042cce2de6 21-Aug-2010 Dmitri Plotnikov <dplotnikov@google.com> Resolving a concurrency issue with directory registration

Change-Id: I9b31d04e87d90db45d16cfdaa7f586b7d0441c20
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
7a3c645fa7db38449d34eb04d4e032fd079c3244 19-Aug-2010 Dmitri Plotnikov <dplotnikov@google.com> New ContactsProvider query: complete_name

We want to allow the UI to switch freely
between a single field name and multi-field name.
For that we need to expose the name parsing/concatenation
machinery we have in the contacts provider.

Change-Id: I51586e309e11a90c719d747862b646de7fb8f326
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
ac13ddd04d665442de846b59234bdc936a6699b4 14-Apr-2010 Bjorn Bringert <bringert@android.com> Use new public API for memory-backed file descriptors

Bug http://b/issue?id=2595601

Change-Id: Ia274e4c5d7098054bec189e28f2172fb864e6e8c
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
53fac8f99f3884c372c907a76766d27fa9e1d95f 17-Aug-2010 Dmitri Plotnikov <dplotnikov@google.com> Switching to a more narrow configuration change notification

Change-Id: I7d8610e6e92331793b768dd951b746753e1be8b6
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
892a3d9ded5c64a63ae3d5d5c52c59528b466c93 13-Aug-2010 Dmitri Plotnikov <dplotnikov@google.com> Improved the phone lookup and the phone filter

a. Altered the phone_lookup table to allow the rows with the same data_id.
b. Added E164 and normalized number for a phone number if it is applicable.
c. Improve the phone lookup by using the build in SQLite function.
d. Improve the phone filter by using 'Like filterparam%'

Change-Id: I1b23d0a10e46ef26467fb72528a7999d23e36c5e
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
8727a729d5c0e875538025f0a85b3ac64c3a7745 13-Aug-2010 Dmitri Plotnikov <dplotnikov@google.com> Fixes following some breakage caused by CL 60952

Change-Id: Ia9fe3a477ab3e4e141773432a969d67168fd6155
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
76dfa406e2cde19c824983c37fc92c1c5bf63eec 13-Aug-2010 Daniel Lehmann <lehmannd@google.com> Fix the build

Change-Id: I750f1c6b4c3d05d93bb07ee306f11486bfd9ce40
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
5b3634b24d3c21618f96860e969fd5c9ba7d9ca8 12-Aug-2010 Dmitri Plotnikov <dplotnikov@google.com> Adding support for query-based aggregation suggestions.

For now exact name match is required.
Will add other types of search later.

Change-Id: Ibc7bca3a7f418da349b318e0e31861268af5f827
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
09ae48b82b17e24016b14a1ab64706222ab1071f 11-Aug-2010 Dmitri Plotnikov <dplotnikov@google.com> Supplying a default projection to Directories

Change-Id: Ie0de59b99624252e4688113fcc6ff52ec75ac8e4
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
f06a42ca707b8c74d0ac9070db5f9767f4fe74dd 10-Aug-2010 Dmitri Plotnikov <dplotnikov@google.com> Syntax sugar for projection map creation

This is in preparation for supplying a projection
to Directories even in the absence of projection
in the original query.

Change-Id: I3c3aa928d02308548349a9407502de943e84a166
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
72e3003a810fb4793a1513d17a40f8ab83d7d0af 05-Aug-2010 Dmitri Plotnikov <dplotnikov@google.com> Introducing ContactDirectoryManager

Changing the contact directory registration protocol.
Now directory providers are mostly passive,
ContactsProvider2 is in control.

Change-Id: I93815f7dc0a30fde35d70c5fd48bb1a924076ff5
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
a549eb3c9627862a3e45d910d5c981191086a949 30-Jul-2010 Dmitri Plotnikov <dplotnikov@google.com> Adding support for all-encompassing contact/entities URI.

Change-Id: I65821cf0abe2c8a94abd9168e80a0a098c1e2a1f
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
dd300fe5f5a1071b1c135af7c76e3ae149edda4d 29-Jul-2010 Dmitri Plotnikov <dplotnikov@google.com> Fixing two issues with CHAT_CAPABILITY

Also, adding tests for all projection maps.

Change-Id: Iadf6b534905ad09fc15d799837d60dc8b1e91c3d
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
2d34c281a9b6ebb9db96fc9ac1092c46d5be6b57 18-Jul-2010 Vasu Nori <vnori@google.com> resolved conflicts for merge of aabcd1d3 to master

Change-Id: I458594d5ea2fd0735499b2d17aa4c35b81cb0077
97fd30388bd6530f86679510cd7b43b9c518bcef 17-Jul-2010 Dmitri Plotnikov <dplotnikov@google.com> Implementation for new ContactsContract API

Change-Id: I91eb0bc2184f65185a342aa3761afe8549b9e640
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
aabcd1d34a71ad06ee0a9395331540484f1ceb17 15-Jul-2010 Vasu Nori <vnori@google.com> add chat_mode to presence_db tables: presence, aggregate_presence

Change-Id: I62fc49669217a6136e31164713dc25a5296721ef
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
5bfdcad228817e2edd2cdbfc69a9b16d411b1533 24-Jun-2010 Dmitri Plotnikov <dplotnikov@google.com> am 4f20a360: Avoiding a race condition caused by configuration change during FroYo upgrade

Merge commit '4f20a360a2f0a7a83900c28fc7728542b38d8939'

* commit '4f20a360a2f0a7a83900c28fc7728542b38d8939':
Avoiding a race condition caused by configuration change during FroYo upgrade
4f20a360a2f0a7a83900c28fc7728542b38d8939 24-Jun-2010 Dmitri Plotnikov <dplotnikov@google.com> Avoiding a race condition caused by configuration change during FroYo upgrade

Bug: 2789091
Change-Id: I8515521eeea83e11c9b14eface70e3f86bf51974
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
d829c82236bb636c816c25b384a28b4d99f0ed0f 23-Jun-2010 Dmitri Plotnikov <dplotnikov@google.com> am 80952e03: Resolving a race condition in upgrade to Froyo

Merge commit '80952e03e425a04ea2fd77e3ff44a8453ffdefe1'

* commit '80952e03e425a04ea2fd77e3ff44a8453ffdefe1':
Resolving a race condition in upgrade to Froyo
80952e03e425a04ea2fd77e3ff44a8453ffdefe1 23-Jun-2010 Dmitri Plotnikov <dplotnikov@google.com> Resolving a race condition in upgrade to Froyo

Bug: 2789091
Change-Id: I4adb18ca019d50215129c2c7ec088b49438d053f
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
d3d812af96f7d77e13dc60652626b39f25907147 07-Jun-2010 Dmitri Plotnikov <dplotnikov@google.com> Initial implementation of the directory API

Change-Id: If8cb0a1fc32dba0ac47502d9f86b43e0e0add8b8
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
4fc28fe621d98e1a1997c64a1305f95e7a295b5f 07-Jun-2010 Jeff Hamilton <jham@android.com> am c085b3ee: Avoid long running upgrade work on the main thread
c085b3eeebf13ebdfb197444747354a1d6eced2b 04-Jun-2010 Jeff Hamilton <jham@android.com> Avoid long running upgrade work on the main thread

Pre-froyo devices didn't use the shared
preferences to track the locale, so they will
always return null for the "providerLocale" even
if the database has thousands of contacts present
so it's not safe to run the setLocale() work from
the main thread.

Report locale change time in uptimeMillis()
so the report is correct across clock changes.

Bug: 2722569
Change-Id: I493596d657f5e02fca8174d998da1fae1115728d
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
219c2a98c2b79da6cfcf2ba05fe985c5534b87ac 18-May-2010 Daisuke Miyakawa <dmiyakawa@google.com> Make ContactsProvider use a static version of vCard library.

Bug: 2689523
Change-Id: If012a8aa061c6b3874e494779edb73c9e8e106b6
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
e3e79030101447da07547647bad225686eb9b8df 19-May-2010 Dmitri Plotnikov <dplotnikov@google.com> Preventing unnecessary update of contact visibility at boot time

Bug: 2511409
Change-Id: I5191cc424adbaa97648db9cedee6573a16b0232c
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
4394086494fe7909aaca70f56fb4bb08beebf303 19-May-2010 Dmitri Plotnikov <dplotnikov@google.com> Changing the db structure to keep visible contact ids in a separate table.

Change-Id: Ic5a5c671cae7b893c87112b9c014e2797d60d8a3
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
2149ab82f021c204618d0d3644e261fd7a8d8490 05-May-2010 Dmitri Plotnikov <dplotnikov@google.com> Adding support for contact/lookup/*/#/data URIs

Change-Id: I941b6e9c7c47a30bbd975881ba755ba0c5862401
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
c9e6d75562621a3dee26a99c2b082e2fd9b0c8b3 04-May-2010 Dmitri Plotnikov <dplotnikov@google.com> Fixing filtering with an empty filter

Change-Id: Ieb1257573cae88e83abf3217a31a4e1ff187eca6
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
dd5c25c65f09ada246c826fb6d04f0b6d4cf4388 13-Apr-2010 Fred Quintana <fredq@google.com> move favorites and my contacts group handling to the provider and sync adapter

Change-Id: Ia2aa3b7d5ede8ce00adbd957a2cae5d89051cf4c
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
80d7871ca31d604cbfd857661d5300bb090076db 16-Apr-2010 Daniel Lehmann <lehmannd@google.com> Add NAME_RAW_CONTACT_ID to view_contacts

Change-Id: Ib889d1cc43e4551b9f7887bf3c808140f2bf16a3
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
7f786e5cbde9975b9632beb9b6d19eeef8a64cf1 15-Apr-2010 Dmitri Plotnikov <dplotnikov@google.com> Using strict projection map

Change-Id: I36e42e5277e94da754e1c2c0e33d59a4c4018ef3
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
ee0e6b105832366143e4ddb30beb5bb0e5c81ec5 09-Apr-2010 Bai Tao <michaelbai@google.com> 1. Rebuild locale related RowHandler when locale was changed
2. Don't save adjusted full name style into DB.

Bug: 2582391

Change-Id: I7f6720f59cb452ac19cb7fafac5e704c3d51c2bb
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
45d8626bf586b5c7111fa86324a7201ae8073607 07-Apr-2010 Dmitri Plotnikov <dplotnikov@google.com> Fixing phone number picker in search mode.

The phone number picker crashes if you
try to search by something that is neither
a name nor a phone number, e.g. "&(./"

This is a relatively rare use case for people,
but very common for monkeys. The main reason to
fix it now is to allow monkeys to continue running
and discovering other problems.

Bug: 2473955
Change-Id: Ib48e324b4d3ced262cc90a67471a35765742eff1
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
c64e0fb0655d8e81c22db555b55c953b5b787b01 01-Apr-2010 Fred Quintana <fredq@google.com> revert the stripping of System Group:
from the names of google system groups

Change-Id: I6c132b27a124f4d1d60d791d28419b520523bfb5
http://b/issue?id=2558197
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
69cc3a2b09e2ffb606c6e52a71b604bba526d225 31-Mar-2010 Dmitri Plotnikov <dplotnikov@google.com> Fixing adding a raw contact to an existing contact.

The issue was that the raw contact was inserted
with the aggregation mode == SUSPENDED, which prevented
it from being aggregated with the other raw contacts
in the same aggregate.

Fixing that by forcing the raw contact out of the
suspended mode when an aggregation exception is added.

Also fixing cosmetic issues missed in the previous CL.

Bug: 2558964
Change-Id: I951db8280e09bd8afd825049320f92c23321ec43
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
33fd566fb6eebdd40a900c0c8a2f6dca894d7829 31-Mar-2010 Dmitri Plotnikov <dplotnikov@google.com> Cleaning up dangling pointers after account removal.

An aggregated contact points at a raw contact that
contains the contact name. It also points at a photo
row. When we remove an account, we should be fixing
up those pointers. That's exactly what is done
in this CL.

Bug:2557771

Change-Id: I04bc6b23be31ed53b27b48bd2f92eaa1a0838387
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
6dddb9abd6f738e43b41a4687c318533085ff0c7 26-Mar-2010 Dmitri Plotnikov <dplotnikov@google.com> Removing broken SQL

Bug: 2548819
Change-Id: I81a754d93ddda2e484e7d5276a6263c491baa066
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
7ceafd016eb07d2de808d18cd5a9463efaee781d 26-Mar-2010 Dmitri Plotnikov <dplotnikov@google.com> Reflecting name/phonetic name change in name lookup

Bug: 2152608
Change-Id: I56130e9a2ea0a3e7fc62490caf02040591ce6b19
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
f8536aaa7a52b9a7a353bc54e158becdbe79ec87 25-Mar-2010 Bai Tao <michaelbai@google.com> Put the contacts on the phone into My Contacts group.

Change-Id: I71964d3bcb026ea2c3d09438bcbcf0ed474c1886
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
767e109d6f08749b9ed202c0b71f3459eaae2115 26-Mar-2010 Dmitri Plotnikov <dplotnikov@google.com> Deprioritizing twitter pictures in contact aggregation

Discussed the solution with Tim Sullivan, got a Dr.No approval
for fixing the issue in FroYo and for the solution itself.

In two separate CLs we will set picture priorities for
Facebook (5) and Twitter (3)

Bug: 2535693
Change-Id: I3d90474d92b58db2845a43658845176260c24812
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
afbf2a3343d0f8e7ae7cbfbbec60004ed37caf3f 24-Mar-2010 Daniel Lehmann <lehmannd@google.com> Publish NameRawContactId in ContactData-Query
Bug:2534647

Change-Id: I9b063282b0ec430bd7ce64a946ec2699b0406781
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
3b10d3a1ed1052dcdf529da370cb71b74164b158 23-Mar-2010 Dmitri Plotnikov <dplotnikov@google.com> Adding phonetic given name to contact name lookup

Bug: 2536325

Change-Id: I66c03e118cef1ccf9449010752dd6ee76b9305cc
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
d5a176cfe6d8701ae8b7882596711e5fc2746be1 19-Mar-2010 Daniel Lehmann <lehmannd@google.com> Construct a SQL string instead of using parameters to not run into param-count limits
Bug:2528389

Change-Id: I6bce9eb299d1686fd11445196285ec4b7e5e1492
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
bc487a312a84972f03776cdc5784cc132a57f8fd 20-Mar-2010 Dmitri Plotnikov <dplotnikov@google.com> Fixing NPE in isWritableAccount

Change-Id: I56410fd4846231bd574c89c04c51f6cb779a5945
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
e8d2c8276d6331843410c97751e46fc50b257379 20-Mar-2010 Dmitri Plotnikov <dplotnikov@google.com> Support for Data.CONTENT_URI URI for photos

Bug: 2530676
Change-Id: Ibad58c047713fe4e9e13fb0d0ce660f3e852f0a8
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
73f1f396c155b247b903d8f4111db17d3e13dc4d 19-Mar-2010 Dmitri Plotnikov <dplotnikov@google.com> Favoring editable contact name over read-only

Bug: 2528277
Change-Id: Ic67fa43eeb9dd215874450f1a78f16846b598d94
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
de8f19d5cc1ef7d5bd76ede6be888dad37112966 24-Feb-2010 Daisuke Miyakawa <dmiyakawa@google.com> Use PHONEBOOK_COLLATOR toward sort keys, assuming sqlite already has the custom collator.

The phonebook collator is newly intruduced for sorting contact list with what people
expect toward phonebook (the term being used in icu4c, so we don't use "addressbook" or
the other term here). Currently the locale ja will be affected since the collator is
enabled only in that locale.

In the future, we may
- introduce the collation toward other locales (e.g. de has phonebook collator already)
- remove this collator if there's some serious side-effect

So, at this time, do not use this collator toward other columns.

Bug: 2373553
Bug: 2373557
Change-Id: I8a7bec5c2a225a07d4e883d43dfd6fdb2e849047
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
743eac356404195f236ad44379fe9d180beb5bf2 19-Mar-2010 Dmitri Plotnikov <dplotnikov@google.com> Optimizing the "all accounts" query in ContactsProvider2.

Change-Id: Ia6f8d36956397757c7c246585e37462d09c20337
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
b2e27298ae54ec2215eadf98ecc100aedba98d1a 18-Mar-2010 Dmitri Plotnikov <dplotnikov@google.com> Storing legacy contact status in the database.

We have run into this situation: in a low storage case
contacts were converted, but then the new database
crashed and was recreated as empty. The import process
was not retried because the provider was thinking
that the upgrade was successful based on a value
stored in shared preferences.

Now the value is stored in the target database thus
forcing the provider to restart the import process
if the database gets corrupted after it's complete.

Also, addressing an inconsistency in the provider that
could lead to compiled SQL statements being detached
from their database.

Bug: 2498528


Change-Id: I77e864fa98a86918d31123f4d3488ae1b1b44bc2
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
813fd5712e0ad264ff6907c85d68a01fb1255d28 18-Mar-2010 Dmitri Plotnikov <dplotnikov@google.com> Avoiding unneccessary aggregation passes

No longer triggering contact re-aggregation if the data
is changed to its current value.

Also, skipping aggregation when all that's changing
is sync adapter technical data.

Change-Id: I6494c998f5e9b336b45dc04787d0b6f5a1851f6e
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
f5a847e8c93db02f3334dbc276debd90bdea5658 16-Mar-2010 Dmitri Plotnikov <dplotnikov@google.com> Fixing handling of aggregation mode

Aggregation mode was handled properly when each change
was in a separate transaction. This CL makes it
work the same when multiple changes are made
within a single transaction.

Change-Id: I39b3c6378f02b2468e559e9d5227809ab463aa2d
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
bd578a748ab5bd74aa63511cce8769d5882f4651 13-Mar-2010 Dmitri Plotnikov <dplotnikov@google.com> Implementing legacy contact upgrade under low storage conditions

Bug: 2498528
Change-Id: Ibd7aa458f665fea71192ce7ff1743f064acb3858
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
42aff67de3f0f4b8664a74fe6ff63ae191aa51bf 12-Mar-2010 Daniel Lehmann <lehmannd@google.com> Ability to create VCards containing several contacts
Bug:2501468

Change-Id: Ie28f1617d8ca02539eaf7bff90cc9decfa4e4ac6
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
609cc5b4c96a6981f675a70ff743ecfec2b448e6 11-Mar-2010 Daniel Lehmann <lehmannd@google.com> Update visibility after accounts have changed
Bug: 2268520

Change-Id: Ibd55a44ca626c52b57375fb88b3401678f50c7fd
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
48786768751cdd9868fb3cf3c82d63f277a54b6f 11-Mar-2010 Dmitri Plotnikov <dplotnikov@google.com> Enabling search by phonetic name

This will not apply to existing contacts yet. I will do
a database upgrade in a following CL.

Bug: 2443866

Change-Id: Iee844df16e7cd8b0c0bc8cd19c9a13532589cf38
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
65ce381c2bb7ddcc3e7d3b8f5f7095831be97603 10-Mar-2010 Dmitri Plotnikov <dplotnikov@google.com> Fixing call ordering during ContactsProvider2 initialization.

The cached mime type IDs were being used before they were initialized.

Bug: 2504223
Change-Id: Ic3f18aebeabf7f16abdab9f034502cfd4e4600e4
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
f0da835940ab6ae1aa37e0ba2ddd29c3117eb212 10-Mar-2010 Dmitri Plotnikov <dplotnikov@google.com> Fixing contact list breakage caused by rapid switching between locales

Bug: 2504328

Change-Id: Ibd956e35b3bb9eaead8b9253bd2becbd4a5ab326
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
60de6f6c3c70e53b603a47b0efc80993353a8368 10-Mar-2010 Daniel Lehmann <lehmannd@google.com> Fix lookup of lookup-keys that are encoded (e.g. Exchange)
Bug:2497276

Change-Id: Icc503f48bdb96eac077db9b1279485d0a0034340
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
cdd03b2ba03718a7fa85663a2438136284a1557c 08-Mar-2010 Bai Tao <michaelbai@google.com> Filter English contacts by initial char in Chinese Locale
Filter Chinese and CJK contacts by initial char in neither Japanese nor Korean locale.

Change-Id: Ie20b081a96421c56f1713cb676946743704549f3
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
89f1f71495aedc58252b3f58a46a036986c319d2 09-Mar-2010 Dmitri Plotnikov <dplotnikov@google.com> Fixed SQL syntax error broken by change 42758 (take II)


Change-Id: Ibc1dabb85b38247c00c252a35b1ac61688deec6f
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
90507ed329506c5de6206e9eebc6c44a7abfdb7d 09-Mar-2010 Dmitri Plotnikov <dplotnikov@google.com> Fixed SQL syntax error broken by change 42758

Change-Id: I294c3a532c79473e79eb615e91bc4b673c6b6525
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
51f41be3b905c63ccffcdc82ec58cf5f7ded2c34 09-Mar-2010 Dmitri Plotnikov <dplotnikov@google.com> Rebuilding contacts sort and lookup keys on locale change.

Bug: 2476633
Change-Id: I25ba9521e7247907d4fa8c0148091d9d67e4e389
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
09c6613dd14cb1911da5d62e39a4e54eb8f4666f 09-Mar-2010 Dmitri Plotnikov <dplotnikov@google.com> Adding basic support for the new ContactsProvider status URI

Bug: 2498528
Change-Id: I3f27ef0c1cc2efaaef4045f0d03271ae92879ed5
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
f84478382761d74b9fb98c4189de66002c04cef8 24-Feb-2010 Sang-il, Lee <gendoh@google.com> b/2481029 Support searching with lead consonants for Korean names.

Change-Id: I7d60da3300c61571b293e2bda5a3440a8a35d16c
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
08768a0f3434130fa46379c1bbfec93a19094939 06-Mar-2010 Dmitri Plotnikov <dplotnikov@google.com> Making two changes: extracting actual address from an RFC 822 address and making matching case-insensitive.

Bug: 2254140
Change-Id: I9827f5646664fc2b744c01cc00bd05617ac06fb6
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.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/ContactsProvider2.java
2526f94e532ac973c846db0099f94b375a23be93 05-Mar-2010 Dmitri Plotnikov <dplotnikov@google.com> Switching from string builder to "?" notation for status update statements in ContactsProvider

Bug: 2378148
Change-Id: I0e909042767d4056157bd1c8b3140aa57d630aea
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
9005e312949b4624aae6953dbdab2eaee1650835 05-Mar-2010 Dmitri Plotnikov <dplotnikov@google.com> Adding a mime type for the phone lookup URI.

Bug: 2486764
Change-Id: Ie94456ff9125d6b981b8dac8f8d160c976db2a94
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
d806946b6561dca3f34ded156c6ee89a5113996e 05-Mar-2010 Dmitri Plotnikov <dplotnikov@google.com> Preventing Chinese shorthand keys from being inserted for non-Chinese contacts.

Bug: 2488839
Change-Id: I0999284fb2eb651af7c3cb00d3f991ab157a3b28
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
fa4a38c9d54f3e3aad4674867bb1250f450c0b95 04-Mar-2010 Dmitri Plotnikov <dplotnikov@google.com> Making exceptions more verbose in ContactsProvider2

Change-Id: I32f7d5d4a4bbd8468ac174d5c0cb4f6521806272
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
9fcf109b56cec0aad05322a3b4594228ea06d859 04-Mar-2010 Daniel Lehmann <lehmannd@google.com> Lookup of contacts with known ID and LOOKUP fixed. Used to be a problem for contacts without names
Bug: 2179909

Change-Id: I33bb9e5174d7db81b5502c5bb8f38f861720a104
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
bfd59cb11248659d12a379394774da8ff6f36cef 03-Mar-2010 Dmitri Plotnikov <dplotnikov@google.com> Switching to the new SQLite extension function, GET_PHONEBOOK_INDEX

Bug: 2407129
Change-Id: If8ff2ddee9a222de061ea84b043d19a8e8503944
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
ae7733451f6ddf3246efcd7fd4fc6882eefa6657 03-Mar-2010 Dmitri Plotnikov <dplotnikov@google.com> Retrofitting Eclair/Froyo changes into the legacy contact conversion script.

Bug: 2461372
Change-Id: I587a8654c0d14d7145230238fe44585a65803698
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
96b7618a3996f2f356cb33553e76877d23a996f2 02-Mar-2010 Doug Zongker <dougz@android.com> reuse SQL statements with different selection args, correctly this time

Change-Id: I9b7fb16b4bcd9c90537134ac333b252fe80b9e69
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
0ea545354bb1c43d117c2eca28df078fe63af3c7 02-Mar-2010 Doug Zongker <dougz@android.com> Revert "reuse SQL statements with different selection args"

This reverts commit 7cac580efadfcbfeedc15802a436f774f9d134ce, which
breaks the unit tests.

Change-Id: I3d9cb75992eaecbf7acc5fb01d3b8d7513f88d38
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
7cac580efadfcbfeedc15802a436f774f9d134ce 02-Mar-2010 Doug Zongker <dougz@android.com> reuse SQL statements with different selection args

Change-Id: I70f7088a4c401145c2e6b7fa3fa6a5fd97db9606
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
04b7ce026c73077d9d982742bc662ea4b3ac74e7 27-Feb-2010 Dmitri Plotnikov <dplotnikov@google.com> Rebuilding contact name lookup during an upgrade from Eclair.

Bug: 2476275
Change-Id: Icda3e0d57ba053978fc0bc8c7e961db2b8b5a69c
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
d0569511c4b9eb961d5a73be16edb9767fa9c2eb 27-Feb-2010 Dmitri Plotnikov <dplotnikov@google.com> Refactoring common nickname cache into a separate class.

Change-Id: I88529053ea3643b35d34cb6acadf6f0d8327479b
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
b06484032125877d1a89785a1a912ca58c12d448 26-Feb-2010 Dmitri Plotnikov <dplotnikov@google.com> Fixing contact lookup by email or nickname

Bug: 2472887
Change-Id: I7010292dd1f189ae0fc18340ebc263664e1f15f8
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
9c6ef008d92017108e3d10dcd8e2146eded9e148 26-Feb-2010 Dmitri Plotnikov <dplotnikov@google.com> Reflecting the rename of contact search snippet fields.

Change-Id: I0dec0d2b32c099f39f5f74239c9ba397a6fc414f
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
9d9673d6a93926c337e23b7e2dcfb9aebc43e9ab 25-Feb-2010 Fred Quintana <fredq@google.com> make the ContactsProvider2 abort the request by throwing an exception if the sync state to update no longer exists
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
916f2d7104bfba857412a66b40ed60fea6546222 25-Feb-2010 Dmitri Plotnikov <dplotnikov@google.com> Adding support for contact search snippets

Bug: 2447965

Change-Id: Id531ca694173751392961510e1207215113b323d
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
f3f4a385d8d1d6788ba79ca353d02235de1d9b33 18-Feb-2010 Dmitri Plotnikov <dplotnikov@google.com> Fixing NPE in the A-Z contacts list.

Change-Id: Ib67cbcf603e5efa6f24c0a60dc59e5cd2fe0367a
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
ba2c85b4700fbb3ecaf75e1101735f60b5483527 17-Feb-2010 Dmitri Plotnikov <dplotnikov@google.com> Implementing the "count contacts grouped by first letter of sort key" URI.

Bug: 2407129
Change-Id: I42a2977650c167cb55a363830503b69feb7ebdb3
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
7a2a564e9a72969999821142c821eb1b912f0d95 15-Feb-2010 Daisuke Miyakawa <dmiyakawa@google.com> Use ContentProvider2 use VCARD_TYPE_DEFAULT in VCardConfig instead of using invalid String "default".

Bug: 2377678
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
2b7a632bba423357ae5641f94da6a2f71afc523b 08-Feb-2010 Dmitri Plotnikov <dplotnikov@google.com> Fixing lookup key update for unsynced contacts.

Bug: 2377667
Change-Id: I3d4ba2fed436d2f322285740b66563f1b0e4e864
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
31168f49a3da9b9a9d5346f3d6a8098b76179c9c 06-Feb-2010 Dmitri Plotnikov <dplotnikov@google.com> Fixing contact lookup by company name and title

Bug: 1360100
Change-Id: Ic897ee1cb9e1c11c858b85b4c0c1d364fabccaad
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
4cd13c4266d8e476e1a49c4b6bcd5b18c33d0de3 21-Jan-2010 Bai Tao <michaelbai@google.com> a. Fix the issue that the FullNameStyle is not updated when user edits the contact or the contacts being synced.
b. Add Chinese sort and search.
c. Adds a CJK check for each contact at runtime. per discussion with component owner, will tune performance later after Korean and Japanese features are added.
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
f01c876a92b9c950a0450ed8b706ac5eb2c9b660 20-Jan-2010 Dmitri Plotnikov <dplotnikov@google.com> Support for the RawContacts.NAME_VERIFIED field.

Bug: 2164422
Change-Id: I144819b04bbdb506d9e582de490fd3aa42cb0682
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
ba355248c255551bc65d8023b968513cbe9bcdf3 25-Dec-2009 Jeff Sharkey <jsharkey@android.com> Correctly report unknown vCard size for OpenableColumns.

Fixes http://b/2332466
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
2d2ec88b7af615b2f05e987da45425be9cace1ba 23-Dec-2009 Tom O'Neill <tomo@google.com> Contacts provider uses LOOKUP_KEY for search result IDs

The lookup key is more stable against merges, etc. than the contact ID,
so we are switching to that for the ID values used in search results.

Bug: 2294798
Change-Id: I09e03212828ec473b69968eb00d490785e15edbe
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
e246689441b2ff39cb97de277d6caeec95358863 13-Nov-2009 Jeff Sharkey <jsharkey@android.com> Require both or neither ACCOUNT_NAME and _TYPE.

In places where Accounts are used, this change enforces that
both or neither of name and type are provided. It changes
behavior of resolveAccount() to throw instead of returning
boolean.

Fixes http://b/2258771
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
5dd6d5d4acb93adc05f1fde904080787f2397f51 21-Dec-2009 Dmitri Plotnikov <dplotnikov@google.com> Resubmit: Adding support for new Contacts columns for names and sorting

This is in preparation for fixing bugs:
Bug: 2075641
Bug: 2021660
Bug: 2164422
Bug: 2267198

Change-Id: I7696abe8c8fd17d8854632cc8e818b9e4d2e643c
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
bca1c8b44f99528fc123d5547723e44771e8e934 21-Dec-2009 Mike Lockwood <lockwood@android.com> Revert "Merge change Ief95261a"

This reverts commit 003009d47e893df100d4020c708296b23c03d28f, reversing
changes made to 5b3b3ec368625c07a2c94d2199a75099d4d9b8a9.
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
b0812f94fa50c54d06978cdd65651a487c717dff 19-Dec-2009 Dmitri Plotnikov <dplotnikov@google.com> Adding support for new Contacts columns for names and sorting

This is in preparation for fixing bugs:
Bug: 2075641
Bug: 2021660
Bug: 2164422
Bug: 2267198

Change-Id: Ief95261a0f4e2c78b216a842cad47f42ef2935c2
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
6e38acbd1e72c62a6f8917297aed97e35c0c4697 11-Dec-2009 Vasu Nori <vnori@google.com> Update times_contacted manually since triggers to do that are gone.

This is fallout from CL # 35440. this change seems to effect only the unittests
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
9b1bd62417ef1764829398a61c3d5df93a924106 10-Dec-2009 Vasu Nori <vnori@google.com> drop a couple of triggers on contacts tables and move them to code.

the triggers in question are the ones that update times_contacted column in
contacts, raw_contacts tables. these triggers had to be rewritten to make
them work woth sqlite 3.6.20 (current version of sqlite in android is 3.5.9).
so, instead of rewriting them, taking this opportunity to moving them to code.
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
62318e1ea8306142a10526534b7d83560ecf5b3a 07-Dec-2009 Fred Quintana <fredq@google.com> changed to use the new EntityIterator interface
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
7318f9e11bdac5ea1ff5e6a8143b90c4e5c497f6 03-Dec-2009 Dmitri Plotnikov <dplotnikov@google.com> Removing unnecessary limit on name lookups in global search support for contacts

Having a limit on the number of name lookups was a bad idea
to begin with: you may be looking for one visible contact and
name lookup would yield 500 matches of which 499 are invisible,
so you would consistenly miss the one contact you were looking
for.

I have confirmed that removing this limit does not affect
the performance of the query too severely. With a set of 5000
contacts all starting with the letter "D" I still got the
one contact I was looking for in less than a second on Sholes.


See bug http://b/2298674

Change-Id: Id4219dea1be2f9ac885ef5ddda5e8376c3e050ee
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
fada1f08e7ffc8012bf2175f61f3ef3270eba9ec 02-Dec-2009 Dmitri Plotnikov <dplotnikov@google.com> Adding a new column to Contacts: NAME_RAW_CONTACT_ID

This is in preparation for fixing bugs:
http://b/2075641
http://b/2021660
http://b/2164422
http://b/2267198
and merge with eclair-china CLs having to do with sorting using pinyin names.

Change-Id: Ifa5b442e9230a8f4fe07334c394a775f18c09218
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
07ce1624de652aa8494630a071b051a1670c4e3d 26-Nov-2009 Dmitri Plotnikov <dplotnikov@google.com> Optimizing the email filter query.

In order to make the query perform, I had
to break out two separate nested queries:
one for the email lookup and one for name lookup,
and build the UNION of found _ids before
retrieving suggestions from the Data table.

Performance of the query is improved by orders of
magnitude.

All tests pass.

Bug: http://b/2286776

Change-Id: I0ff20aa2bd3bcfc765831390a36274c01e0e16e3
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
dc947a9d03279eab0fb7c3b9d8ffbb492c1e2062 25-Nov-2009 Dmitri Plotnikov <dplotnikov@google.com> Optimizing global search for contacts.

Enabling some indexes, disabling some other indexes creates
the effect of a nice optimizations.

Bug: http://b/2139526
Change-Id: Icaed50ed35310d104dbba338daf757395b3792d1
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
04d535c37a0ea66f5cf2d95f9df7b5b96ef3a5f5 06-Nov-2009 Dmitri Plotnikov <dplotnikov@google.com> am ea029fd7: Making it possible to place and take calls in low storage situations.

Merge commit 'ea029fd79225640e49be82457b83b6b3a0279fd0' into eclair-mr2

* commit 'ea029fd79225640e49be82457b83b6b3a0279fd0':
Making it possible to place and take calls in low storage situations.
3410a80f4aafe5685da61c217808d2bf21d55dfc 06-Nov-2009 Dmitri Plotnikov <dplotnikov@google.com> resolved conflicts for merge of 1c8e40c1 to eclair-mr2

Change-Id: I5c8e9e76c79a5c70d214bc0b28360c41c07e7b85
ea029fd79225640e49be82457b83b6b3a0279fd0 06-Nov-2009 Dmitri Plotnikov <dplotnikov@google.com> Making it possible to place and take calls in low storage situations.

Bug: http://b/2182531
Change-Id: I5c88a3024ff1c5a06b5756b29a2d903f8f6a2531
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
1c8e40c18f92722b9bec6e8ce2e345a9828efa16 06-Nov-2009 Dmitri Plotnikov <dplotnikov@google.com> Fixing legacy contacts API breakage uncovered by CTS tests

Bug: http://b/2236480
Change-Id: I653a0c0c012f7f125e75e5436cdf66e31402444c
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
4da1b8ded4435a3392bac3511c67182015e0953f 05-Nov-2009 Dmitri Plotnikov <dplotnikov@google.com> Replacing argument concatenation with selection args arrays.

This takes advantage of the new SQLite caching mechanism introduced
in CL https://android-git.corp.google.com/g/#change,30704

Reduces the number of queries in SQLite cache
from 1200 to 200 for an 800-contact sync.

Change-Id: Id36664f2687b7612c2f38c760437b633b01bb467
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
e2d20aa1ab5de52ee4a4f5ba3cffcc1166a0b44f 04-Nov-2009 Jeff Sharkey <jsharkey@android.com> resolved conflicts for merge of bf6a7e4d to eclair-mr2
bf6a7e4dece49ba4e7cda17f7ed9250aeb82f731 03-Nov-2009 Jeff Sharkey <jsharkey@android.com> Expose IS_RESTRICTED field through queryEntities() views.

Part of fixing http://b/2223256
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
b4e61e064b59e8076df81b061add9fb358fd2ed9 31-Oct-2009 Dmitri Plotnikov <dplotnikov@google.com> resolved conflicts for merge of 62715245 to eclair-mr2
627152453c692915ac79191acd1d2d2a4dd6fb0d 30-Oct-2009 Dmitri Plotnikov <dplotnikov@google.com> Making the first account "adopt" contacts created on the phone before any accounts

Bug: http://b/2222360
Change-Id: If55205305e0673ab3e22f8da5086a772f9990c22
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
f7f747a00f4fa7a9e564507693419a5a8db0eb8f 23-Oct-2009 Dmitri Plotnikov <dplotnikov@google.com> ContactsProvider2 optimization: two hot spots: parsing query parameters and allocation of Account objects

Stats:
Baseline: 830 yield points, 72 ms per yp, objects: 964 per yp
Optimized: 830 yield points, 72 ms per yp, objects: 772 per yp

Change-Id: I467ba6de114bb73bd0725c3c1fb534db0c1425d1
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
1129311abb3db9bf6eb5731da054276164e0b8d1 22-Oct-2009 Dmitri Plotnikov <dplotnikov@google.com> ContactsProvider2 optimization: end-of-tx contact insert - switching to compiled statements and reusing buffers.

Stats:
Baseline: 889 yield points, 75 ms per yp, objects: 1047 per yp
Optimized: 889 yield points, 72 ms per yp, objects: 964 per yp

Bug: http://b/2208650

Change-Id: Iec3596a18e5a0cc614a16a9aab016a02ad4e55e6
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
d076a108d58b30591f197e1b90fa8de60999c499 23-Oct-2009 Dmitri Plotnikov <dplotnikov@google.com> Removing contact aggregation scheduler. The aggregation is no longer running in a separate thread.
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
a48ddb6e3a888c72765bf83a5705c544995f5340 22-Oct-2009 Evan Millar <emillar@google.com> am 5e28b3a5: Fix favorite ordering bug (http://b/issue?id=2197247)

Merge commit '5e28b3a5e44bf4f2c0980c50a2ab35350fc5f230' into eclair-mr2

* commit '5e28b3a5e44bf4f2c0980c50a2ab35350fc5f230':
Fix favorite ordering bug (http://b/issue?id=2197247)
5e28b3a5e44bf4f2c0980c50a2ab35350fc5f230 21-Oct-2009 Evan Millar <emillar@google.com> Fix favorite ordering bug (http://b/issue?id=2197247)
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
a8d8b1cb48a6e94645dbce836193b40c7481356c 16-Oct-2009 Dmitri Plotnikov <dplotnikov@google.com> ContactsProvider2 optimization: accumulating setDirty(true) per transaction

Also reducing allocation of StringBuilders.

Stats:

Baseline:
877 yield points, 97 ms per yp, objects: 1265 per yp

Optimized:
877 yield points, 89 ms per yp, objects: 1256 per yp

Bug: http://b/2148608

Change-Id: Ic3fd7d8fe5c8174a158266d56b8cbf008a073db1
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
36045476d2cc7c9c2f985307e87cb6bbc4cfe434 19-Oct-2009 Dmitri Plotnikov <dplotnikov@google.com> ContactsProvider2 optimization: performing phone matching entirely in the database

In order to perform phone number matching efficiently, we now store the minimum caller ID
digits in a new column in the phone_lookup table.

Bug: http://b/2148602

Change-Id: I2f61f79212e296fde92c35768047f11f997903d4
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
08e42c9c153a60bf2e7c71dd40bf84bb5fc93555 20-Oct-2009 Dmitri Plotnikov <dplotnikov@google.com> Fixing broken build

Change-Id: I4dbc7db9bff950779a4f6ef5a28de4d79d1c479a
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
ab91a8babdbda516d4e5088fedf3fdebf9cf88ad 20-Oct-2009 Dmitri Plotnikov <dplotnikov@google.com> Optimizing ContactsProvide2: reducing the number of group lookups during contact insert.

The "get version" query is coming from the sync adapter. The other two group-related
queries are being eliminated by this CL.

Bug: http://b/2198859
Change-Id: Ie385aabf965d32d29696aacd56548ebb15ff3a0e
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
d0f63551e3147babcebde5326b31285d7bdf6739 20-Oct-2009 Dmitri Plotnikov <dplotnikov@google.com> Optimizing ContactsProvide2: reducing the number of "data" queries during contact insert.

Stats:
Baseline: 851 yield points, 97 ms per yp, objects: 1265 per yp
Optimized: 851 yield points, 79 ms per yp, objects: 1132 per yp

Bug: http://b/2198728

Change-Id: I6bc4b59f391ec653db7bd6ceb3e6332b3b2cf928
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
3684089aba82df3f7a0c111e7c96ed8b0380e57a 19-Oct-2009 Dmitri Plotnikov <dplotnikov@google.com> ContactsProvider2 optimization: Performing name and email lookup entirely in the database

Instead of loading name lookup rows into memory and constructing a query to
find matches, do the whole thing with a single query.

Stats:
Baseline: 880 yield points, 97 ms per yp, objects: 1265 per yp
Optimized: 880 yield points, 88 ms per yp, objects: 1196 per yp

Bugs: http://b/2148604, http://b/2148605

Change-Id: I444e5739e555bb7a6fdd144ac7a5f37930bffed0
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
315dd702d006aedf2f867d3fe49e31e05e4f9a16 15-Oct-2009 Dmitri Plotnikov <dplotnikov@google.com> ContactsProvider2 optimization: using a Bloom filter for lookup of known nicknames

This saved just under one query per name or 2.35 queries per contact
on the test dataset.

Stats:

Baseline:
877 yield points, 97 ms per yp, objects: 1265 per yp

Optimized:
877 yield points, 86 ms per yp, objects: 1245 per yp

Bug: http://b/2148639

Change-Id: I139252ef153ae13cee0f16c4bce6beedbf319945
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
3389f7c7df6c90e48fcb0c27832bc322e5b20bf6 15-Oct-2009 Dmitri Plotnikov <dplotnikov@google.com> ContactsProvider2 optimization: caching raw contact IDs involved in aggregation exceptions

This saves one query per contact.

Number or object per contact (~1700) and time per contact (~125ms on Sholes)
does not seem to be significantly affected by this optimization.
Should probably submit this anyway and see its effect on really
large accounts (e.g. 5000 contacts)

Bug: http://b/2148645

Change-Id: I57457201017463e519ed55dddda75a0d802f0d9a
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
9705f5bcb04c4b3012a762fb3ba8620b518587cc 13-Oct-2009 Vasu Nori <vnori@google.com> add support to update/delete data in status_updates table. update tests.
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
27f039b535f98c1cb1a31207047003235ddaed15 13-Oct-2009 Dmitri Plotnikov <dplotnikov@google.com> [Issue 2183891] Plugging a security hole in ContactsProvider2: callers will not be able to unrestrict RawContacts

Change-Id: I9e43f77e8dfee886695377602ddface2fe03c200
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
c03e723e7b07434a3e60454606bc18e2df4ee06b 09-Oct-2009 Dmitri Plotnikov <dplotnikov@google.com> [Issue 2168777] Favoring visible contacts on insert of presence/status updates.

Change-Id: If581fb64017ca4dc74c5c3f1805fa96f722fa6cd
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
67c9ed1cefa5c084d3f373d7f1ecb7122983ff15 07-Oct-2009 Dmitri Plotnikov <dplotnikov@google.com> [Issue 2171774] Fixing the fixStructuredNameComponents() method

This is effectively a revert of change dd0e0f44fe403ff201d46d5534f7f1148e5ad729
followed by a proper fix for:
[Issue 2160728] Fixing full name update when parts of structured name are deleted

Change-Id: I96e990820938ee79a87411eb926d774c951fa768
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
a0e72d9b20207ec244f92ace2917932990f2bc8b 06-Oct-2009 Dmitri Plotnikov <dplotnikov@google.com> [Issue 2134623] Optimizing the view_data view, which was doing a full scan of the data table.

Also,
[Issue 2168777] Making sure QuickConnect header links to a visible contact (if available)


Change-Id: I0baab1d532ced7f3ac78ea80ab7700850cacbfa1
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
46b7bfa3728bf878d1a9dac9fea35fa629975e1b 05-Oct-2009 Fred Quintana <fredq@google.com> - create a Uri for and expose the contacts entities uri
- change the EntityIterator to use that Uri
- fix the column naming in the entities view
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
dd0e0f44fe403ff201d46d5534f7f1148e5ad729 05-Oct-2009 Dmitri Plotnikov <dplotnikov@google.com> [Issue 2160728] Fixing full name update when parts of structured name are deleted

Change-Id: I3a206a4cfb09be590bf96476d128791129263742
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
f8b937f62fb80445bf59b2e504d765bcab746557 05-Oct-2009 Dmitri Plotnikov <dplotnikov@google.com> [Issue 2157431] Optimizing the Status Update insert into the contacts database.

Actually the part that is being optimized is the lookup of the data row to link the new status update to.

Change-Id: I883cc8969ed47a2c1832f65d4a8b1973d1c64d35
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
5b4b305b9698526c6e82e0e01448b0a5642dd505 03-Oct-2009 Fred Quintana <fredq@google.com> account manager api review changes
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
14b8a1243ab5c043b35e47527ca1c962064f3771 02-Oct-2009 Daisuke Miyakawa <dmiyakawa@google.com> Change selection argument so that it complies with the current view
given from ContactsProvider2.

Root cause: VCardComposer changed the table to look over, from
RawContacts to Contacts, which is with valid ratinale
(Contacts shows aggregated view, while RawContacts does not).

Unfortunately, the change made ContactsProvider2 corrupted, which has
assumed the table VCardComposer is looking at is RawContacts.

Now, after discussing with Contacts team, this change is concluded to
"correct" change.

I changed from RawContacts._ID to Contacts._ID after jsharkey's approval,
but the actual string is the same "_id", so the essential is the same.
The difference is that readers would not be confused with seeing "RawContacts"
in the wrong context.

Internal issue id: 2162658
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
6ce24dc1d53f1ed2760a06cd60c705ebdf666f43 01-Oct-2009 Megha Joshi <mjoshi@google.com> Force sync to happen if Groups.SHOULD_SYNC is set.

Bug # 2093578
Dr. NO: TS
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
3296d3469bce0041a6cefc44d0486a2a7d0c9f82 30-Sep-2009 Jeff Sharkey <jsharkey@android.com> Offer separate social projection when requesting data rows.

Part of fixing http://b/2126683
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
20938cd6df602bf08c232b32fc047592c1561347 01-Oct-2009 Dmitri Plotnikov <dplotnikov@google.com> [Issue 2159148] Restricting email filtering to not show other email for the suggested person

Change-Id: Ic1692de29912f8875e09ed392d48c48558c3b307
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
d91272b48f97243533c6580981e12a4847b5783f 30-Sep-2009 Jeff Hamilton <jham@android.com> Read the unrestricted pacakages list from XML.

Change-Id: I9af814b8bb1b95051a0371d1e3d3769c052ffd95
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
c76cdd0723b99f478c9ba5329d14a971cd8dfb3d 30-Sep-2009 Costin Manolache <costin@google.com> Remove GAIA string
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
763100dcfabb368e72f25d24fe181c352bdb66d6 29-Sep-2009 Evan Millar <emillar@google.com> Read query parameter REQUESTING_PACKAGE_PARAM_KEY to determine whether to restrict data.

The requesting package is compared against a white list of packages that
have permission to see restricted data.

Change-Id: I4fcf19f99be68998f6e5b12e2d32b9fe56de68ec
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
b38ed2c5ffeb20efc677b4a9229db4a00603aa8d 29-Sep-2009 Dmitri Plotnikov <dplotnikov@google.com> Renaming OpenHelper to ContactsDatabaseHelper

Change-Id: Iccdf1ebcd8a3ab430941c957f712bb9e7dd2706c
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
f9aeb84d61c01a473819e9173f8311ca5d678a8d 28-Sep-2009 Jeff Sharkey <jsharkey@android.com> Use separate API for vCards through openAssetFile().

This change fixes http://b/2138790 by providing a separate
Uri when providing vCard-formatted Contacts.
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
0a185cdcb65d1beb2a295fffbe2ae11a6a2c097f 28-Sep-2009 Dmitri Plotnikov <dplotnikov@google.com> Adding support to ContactsProvider2 for status update attribution

Change-Id: Ib98a5fc203a9ce5efb4707b9ce015bd497b8ef10
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
ba965ceeb86dd9404d43f418daae357bc4afbdcd 29-Sep-2009 Jeff Hamilton <jham@android.com> Fix handling of times_contacted.

Change-Id: I1fc10736cf4848acdba657fdefabf00a711fd56b
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
d237c80845d8e13164d34278d3c20e31f8d80b4d 28-Sep-2009 Daisuke Miyakawa <dmiyakawa@google.com> Make ContactsProvider2 check FOR_EXPORT_ONLY query parameter and restrict
data access even when the application has appropriate priviledge.

This feature is required by vCard exporter/composer, which has to remove
un-exportable data from available ones, but the current provider does not
make such kind of flag ("is_restricted") public.
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
82bd858c9911dfbd8dca52dc276333768b0a429e 28-Sep-2009 Dmitri Plotnikov <dplotnikov@google.com> Adding columns to support attribution of status updates. Also renaming some columns to better describe their purpose.

Change-Id: I2018079e540dedb2be1b61671742bbe99e92619c
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
19cf97e1f8a569ad782756183419b7ba45ce15a0 24-Sep-2009 Tadashi G. Takaoka <takaoka@google.com> Added undo delete handling in update.

Internal Bug: 2138733
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
1a21fa6383449df4bf0d46138a23aa02dfa235a0 26-Sep-2009 Jeff Sharkey <jsharkey@android.com> Replace delayed query parameters with transaction flags.

Callers should instead use applyBatch(), which now delays
any visible updates until the transation finishes. This
partially fixes http://b/2075275

This change also fixes a bug where aggregated visibility
wasn't being updated correctly. Wrote new unit tests to
verify correct behavior.
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
71e051c79a57af70ec7b095074c3e7faf9507b52 26-Sep-2009 Dmitri Plotnikov <dplotnikov@google.com> [Issue 2148072] Adding support for non-public legacy API content://contacts/groups/name/*/members

Change-Id: Ia5128b55bb393fde186e95da086c32508374c035
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
dea2b6389abf1ae0448ae047b4b0a9e423381d77 25-Sep-2009 Jeff Hamilton <jham@android.com> When a Presence.DATA_ID is provided explicitly associate the presence with the provided data row.

Change-Id: I2e9b2125093ce948e46c667430a0e543c6c5c2f2
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
d60cf9ba1d039f1a22375f56c18356e0d4f8ca14 25-Sep-2009 Dmitri Plotnikov <dplotnikov@google.com> As we are now searching for contacts by organization, adding support for search by email as well.

Change-Id: I0856f5a6391bc7f11f8e7063e0bb2cc908ce5348
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
a23cd5b6f478f6c9dda54173e84bd0098b9f3364 24-Sep-2009 Dmitri Plotnikov <dplotnikov@google.com> Storing social status updates in a persistent table.

Change-Id: Ic6be86385a4e456ae164499aeec40900294fb118
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
7d9fdcf8346f789436148eff1f00e8f49b370ef0 21-Sep-2009 Neel Parekh <neel@google.com> Allow updating via raw_contacts/#/data
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
5aec18c7ba70a011ffff949cfa3faaffce0a79c7 24-Sep-2009 Jeff Sharkey <jsharkey@android.com> Offer to delay visibility updates until caller forces.

We now watch for query parameters on insert, update, and
delete for Settings and Groups, which we use to delay
updating of IN_VISIBLE_GROUP at the callers request, which
is going to be used to help avoid ANRs. Also wrote unit
test to verify it works. Part of fixing http://b/2075275
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
5ac5c70d1165309302ebcc931f51723e37d31e0b 18-Sep-2009 Jeff Sharkey <jsharkey@android.com> Limit to account when updating RawContacts.

Fixes http://b/2102133
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
bffeabdf3dcf58f963ad1bb4d3e6e51f3ac16cfd 23-Sep-2009 Dmitri Plotnikov <dplotnikov@google.com> [Issue 2110703] Using triggers to update aggregate contact presence status

Change-Id: Ib1f55ddb926ebafd43c7776cad1db10217fc1bfc
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
a5d05d90333a70d471d78e82caeb5cfa2e4d4c59 21-Sep-2009 Tadashi G. Takaoka <takaoka@google.com> ContactProvider: Make nickname, company and title searchable.

If contact entry doesn't have a name, then nickname, company and title
are used as display name in order of preference.

Internal Bug: 1360100
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
70c314fb9b2ef3d47340b93816d46200aba9f5ec 23-Sep-2009 Dmitri Plotnikov <dplotnikov@google.com> [Issue 2133126] Fixing presence update/insert to do a proper replace.

Change-Id: I4211484b516cfbc5278dc2116fb97ab0daf817f1
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
23c48e7953e2f854eeef6d8e3d3c1b901fc571ed 22-Sep-2009 Fred Quintana <fredq@google.com> fix entity query when querying by id
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
2d89933b87a15ae5ed5d6b6ec4220ac085695ada 22-Sep-2009 Dmitri Plotnikov <dplotnikov@google.com> [Issue 2097207] Adding support for filtering of contact aggregation suggestions

Change-Id: Iabfe6758d4d916bddd88cbc47a133e5bdfd1d722
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
0be993f8ef0078b9825a5ffe6add08a6786d8dac 21-Sep-2009 Dmitri Plotnikov <dplotnikov@google.com> [Issue 2133143] Updating contact visibility as group membership changes

Change-Id: I289bb688958c04f2dd6e89cd0096ece9ed279257
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
f23764675b35b5262a39c79aad8e9842460274b2 21-Sep-2009 Dmitri Plotnikov <dplotnikov@google.com> No longer relying on the components of structured name for aggregation.

Now parsing display name into tokens and allowing permutations of those.

Bug IDs: 2132657, 2132636, 2089893

Change-Id: Idea256bbec3b82fb229199c6bd6e9d7b145ab075
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
48828f54daafda2edb122258c4c6a7d2ca704128 19-Sep-2009 Dmitri Plotnikov <dplotnikov@google.com> Adding support for contacts/data/phones/#, contacts/data/emails/# and contacts/data/postals/#

Change-Id: I6f22e419d29b08b9d9e136d700cc4bd8f35a2397
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
9b43551f1ce33b79141772737a262ce609bd0ceb 18-Sep-2009 Megha Joshi <mjoshi@google.com> Changes sortorder for LIST_STEQUENT.

Fixes bug 1401384.
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
3de6754a90e3682f2f52b99621d0fded060b99ae 18-Sep-2009 Dmitri Plotnikov <dplotnikov@google.com> Making contact name filtering more restrictive: ignoring name variants and email-based nicknames.

I discovered this issue while trying to reproduce http://b/2123390
I typed "h" and saw Erica among the filtered contacts. The reason is that the nickname cluster
id for Erica matched the hex representation of letter h. The fix is to be more specific about
what types of name lookup we are interested in.

Change-Id: If367424052ee8e93757c98ce1dbb435522d8ba2e
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
8f1631f8a610e7278526916ce73ac1e422a5c9b8 18-Sep-2009 Jeff Sharkey <jsharkey@android.com> Add LOOKUP_KEY to distinct data projection.
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
5f9e610be459bd1332e182c41cf7510265d5f7cc 18-Sep-2009 Fred Quintana <fredq@google.com> fix some places where we did not clean all data for removed accounts
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
1ea29714ef8fdd62b71f265f27391c22f4a50340 17-Sep-2009 Fred Quintana <fredq@google.com> clear the aggregation state at transaction start time
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
fc4e892529eccdfa42121f0304ec7d0dbb42d6c9 17-Sep-2009 Dmitri Plotnikov <dplotnikov@google.com> Fixing broken build

Change-Id: I649e79ebf19ccfcc3e4e8969e0fb0268e57ec45c
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
0e8520cf7f15576ce4d66202203770086fd26a71 15-Sep-2009 Ken Shirriff <kens@google.com> Add system property to control contact aggregation.

Boolean property sync.contacts.aggregate will enable or disable contact
aggragation.
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
43880c9228332d0ea1426341fcf712d302b2c55b 17-Sep-2009 Dmitri Plotnikov <dplotnikov@google.com> Waking up sync adapters when sync settings change.

Change-Id: I115ea79816808628da3e36dd9d04e06f07aef60d
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
89c626eb655440c86a2e5df076e83708c1b32c17 17-Sep-2009 Dmitri Plotnikov <dplotnikov@google.com> [Issue 2125440] Checking account query parameters for all relevant queries

Change-Id: Idf0deeacb556b79ef94774a2cb65b7415b1dea5d
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
dee54bb86f3608730f0b9f37d8982a7f6b280a85 17-Sep-2009 Dmitri Plotnikov <dplotnikov@google.com> Fixing breakage of legacy contacts API support broken by an earlier CL

The gist of the issue is that SQLiteDatabase supports one nested transaction, but only one.
The code was executing two nested transactions (not two levels of nesting, just two sequential
transactions) and that was causing the outer transaction to roll back. We really should fix
this in SQLiteDatabase.

So the provider will now call the aggregator before, not after transaction commit, and
the aggregator will not open a nested transaction.

Change-Id: I9fa09d36ea43a62ba4f2fd5e5e1816cc439d225b
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
1443b159afd6149659383ff5fd7b7958d6c077cc 17-Sep-2009 Dmitri Plotnikov <dplotnikov@google.com> [Issue 2112473] Speeding up aggregation by running it on the main thread

This is an experimental change. I don't want to rip all scheduling code out
until we have confirmed that this change is safe.

Change-Id: I38f1b19de1048c4287c99fd53d313d23b06dbdb8
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
341e4621f2ee7614c66bc25dd3da70eaaa866b46 16-Sep-2009 Jeff Sharkey <jsharkey@android.com> Add logic to expose new Settings.ANY_UNSYNCED flag.

Part of fixing http://b/2084771
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
56d2bd40ebb238c2990bc239f68c7e61c7d5b02c 15-Sep-2009 Evan Millar <emillar@google.com> Add lookup_key to 2 projection maps.

Change-Id: I98950f909601da6c32595fb3ed1c4f07b8943023
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
f6be85f72615168c836b05c03ab5fc80d4794a82 15-Sep-2009 Fred Quintana <fredq@google.com> change to use the new CALLER_IS_SYNCADAPTER flag
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
bce6ee29f2d971ceae2bfce85a06bb3ecec6537a 14-Sep-2009 Dmitri Plotnikov <dplotnikov@google.com> [Issue 2084032] Adding support for legacy URI: contacts/contact_methods/email

Change-Id: I9c2c62952b7d24d4e87db8b2c7037f49674276aa
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
8c4f838f899daadb6f46f8c27ab7636023e39c38 12-Sep-2009 Dmitri Plotnikov <dplotnikov@google.com> ContactsProvider2: optimizing structured name update

Also implementing a (safe and correct) bulk update of Contacts.

Change-Id: I2bc1badccfbccf53a9630503e104d11bec0e6396
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
4637c20c6b6d3b6f6671e6a44ed57f1e5b9c4484 12-Sep-2009 Dmitri Plotnikov <dplotnikov@google.com> [Issue 2116081] Removing account's data from _sync_state when account is deleted

Change-Id: Ib7139a2bfaf5ea039da88f0c209f230f14b41717
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
81d6a78dffd57f24f9aaecb6cd54e4084c3c9846 11-Sep-2009 Dmitri Plotnikov <dplotnikov@google.com> Reducing unnecessary triggering of sync adapters by ContactsProvider2

Change-Id: I280cd6d96a76e8df151ddb43b0f1b783501c4373
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
cac7746068de91dc656f4e1f0e01e536eb16016b 12-Sep-2009 Dmitri Plotnikov <dplotnikov@google.com> Removing unnecessary (and very harmful) aggregation trigger

Change-Id: Iadedbf3fc83f267984c94c2c1d2ae7dfe0dd91fd
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
1e530df9f7e496dc47f77d4323c89bd413b79b64 11-Sep-2009 Dmitri Plotnikov <dplotnikov@google.com> [Issue 2111706] Fixing email filter, which was stopping after an "@"

Change-Id: I4b3a00cc79cc6cc3d1351b5a301a36f6a950d688
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
2e990cc352353b2e4d83f1eeecff137b94b84266 11-Sep-2009 Jeff Sharkey <jsharkey@android.com> Handle lookup Uris for delete and update cases.

This helps support atomic operations, like delete and
starred from the UI. Fixes http://b/2102632
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
51bf5ea9531b9da72caff607dbdf35fd6f61cbe2 11-Sep-2009 Jeff Sharkey <jsharkey@android.com> Correct to use RawContacts._ID instead of CONTACT_ID.
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
7581213e160c460671aebdb054b8afd2f138d99e 10-Sep-2009 Dmitri Plotnikov <dplotnikov@google.com> [Issue 2112637] Adding support for Presence to the Aggregation Suggestions.

Change-Id: I40007a7a4fa5fa7eed4c3f98936200024cfcc2cd
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
c1778ef6fa53b6bf08fd715b3ad70c052c5f1ce9 10-Sep-2009 Dmitri Plotnikov <dplotnikov@google.com> [Issue 2102836] Fixing the false positive aggregating on multiple secondary matches
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
d173ca0f279d89030cc7e3f1aadd18755a2e8766 10-Sep-2009 Jeff Sharkey <jsharkey@android.com> Add support to open contacts as vCard asset files.

Similar to how photos are handled, when someone opens a
contact as an asset file, we build the details into a vCard
format and pass back as a MemoryFile.

Also slight refactoring and removal of deprecated API use.
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
dea3ee5e7f84be2abfe35837a460cbe779d319db 10-Sep-2009 Dmitri Plotnikov <dplotnikov@google.com> [Issue 2097210] Fixing incorrect aggregate contact update when splitting a three-way joined contact
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
cb144e1429596701603c016f4a078f6331e6481d 10-Sep-2009 Dmitri Plotnikov <dplotnikov@google.com> [Issue 2108974] Deletion of an aggregate contact will now be synched to the server.

Confirmed expected behavior with a unit test and a manual test.
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
df9db5e99572ce9760eb265683134c1f3293928f 09-Sep-2009 Fred Quintana <fredq@google.com> clear mUpdatedSyncStates in clearTransactionalChanges()
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
6bc46c9f22aaa9e68f344b171426fc686d3b536a 10-Sep-2009 Dmitri Plotnikov <dplotnikov@google.com> Fixing broken tests in ContactsProvider2
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
4529f06d48c8ad3cc573a9b7b8f2f952b1e20dcd 09-Sep-2009 Dmitri Plotnikov <dplotnikov@google.com> Addressing data security issues in ContactsProvider2
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
c100221f706afc08409e8317a27d6850b11c54d3 09-Sep-2009 Omari Stephens <xsdg@android.com> Fix typo: IMMEDITATE -> IMMEDIATE
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
b5a4add17815167d20a90645779df34cdf45280d 03-Sep-2009 Fred Quintana <fredq@google.com> batch up some changes, like the version update, until the end of the transaction
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
01911fa9cfa21f198fd767eedde072acbb879f28 09-Sep-2009 Dmitri Plotnikov <dplotnikov@google.com> [Issue 1789740] Ensuring that organization is used as a contact display name if name itself is unspecified
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
5e99505757457d11d9388f6d04960e97fc776a59 06-Sep-2009 Dmitri Plotnikov <dplotnikov@google.com> Introducing a more advanced email filter, which will do a proper name lookup

Also updating the phone filter to allow the use of a phone number itself
for lookup, including the use of keypad letters.

It uses the normalized name and avoids returning duplicate results.
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
0c0adda32be5de3acf392ab715cff468b6b340f8 05-Sep-2009 Dmitri Plotnikov <dplotnikov@google.com> Fixing contact aggregation exception API.
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
70d2ff8c87961703351b223ce8b15342fe795a0b 02-Sep-2009 Cynthia Wong <cynthiaw@google.com> Add an onAccountsUpdated handler, to delete contacts if an account is deleted.
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
a5bfaf55790262eea97de432d9e7f313c219c066 03-Sep-2009 Dmitri Plotnikov <dplotnikov@google.com> Adding a trigger to implement the "removeContactIfSingleton" functionality.

Also clearing out name lookup and aggregation exception tables upon deletion of a raw contact.
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
622e0a2f00b3de248926ec9e89b11a6425919819 02-Sep-2009 Jeff Sharkey <jsharkey@android.com> Relaxed type and label checking, structured consistency.

For CommonDataKinds rows, we strictly require that TYPE be
set when LABEL appears. Previously we had enforced that
LABEL could only exist under TYPE_CUSTOM, but this doesn't
hold true for providers that want to allow additional TYPE
values to have labels. This fixes http://b/2089080 and
http://b/2065904

This change also helps maintain consistency between
structured and unstructured fields for StructuredPostal and
StructuredName. That is, when an update updates one without
also updating the other, we provide the additional values
required to keep them consistent. If the client specifies
both sets, we let them pass through. Fixes http://b/2087358

Also adds unit tests, including fixing broken ones.
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
3cb415e7b97c3e318d7a16aaf7cc5c6b825d349a 03-Sep-2009 Evan Millar <emillar@google.com> Add IS_SUPER_PRIMARY to Entity query projection.

Change-Id: I3a329a15acfc3f1ecc93d0a4e42f1927e1a99db2
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.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/ContactsProvider2.java
25abcf949c0dd826a770b437489b83de48975cea 02-Sep-2009 Dmitri Plotnikov <dplotnikov@google.com> [Issue 2084618] Making the contact aggregator favor better display names.
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
433a3a08a4726952c080e22e3969ac6c4f28e8df 01-Sep-2009 Jeff Sharkey <jsharkey@android.com> Re-aggregate RawContacts when STARRED touched.
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
be84be1519fe0b73f47c2b2fe9badb8a3e833b28 02-Sep-2009 Dmitri Plotnikov <dplotnikov@google.com> Fixing getType, which I broke in CL 23525
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
b4cfef6f658ecade496351107f6ed2a4818f3e3a 02-Sep-2009 Dmitri Plotnikov <dplotnikov@google.com> Returning the correct content type for CONTENT_LOOKUP_URI
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
a6733943584294492aa0118fc32bf4e58dabb028 01-Sep-2009 Dmitri Plotnikov <dplotnikov@google.com> Avoiding reaggregation when the only thing that changes is the photo.

Updating contact photo ID only.
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
cdbd854decda3f493b395c8867f2cd131d95d09f 01-Sep-2009 Dmitri Plotnikov <dplotnikov@google.com> Making aggregation optional during Donut->Eclair contact import.

The importer will create contacts just like the aggregator would,
but without actually aggregating duplicates. All raw contacts
are still marked for reaggregation, so the dupes are still discovered
in the subsequent aggregation pass.

The user experience is that all contacts show up very quickly (on sholes
we should expect to see 700 contacts within 15-17 seconds). Then a bit
later duplicates start disappearing.
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
1b7a7947242bb3b8caaed871775e62d486144c9f 31-Aug-2009 Dmitri Plotnikov <dplotnikov@google.com> Implementing live folders in ContactsProvider2
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
5870f2dcc2ac7715b2c078a886ee346622e7887e 31-Aug-2009 Dmitri Plotnikov <dplotnikov@google.com> Adding soft identity to Contacts
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
944abb09aa47fc08db668be8909fc4045a681117 29-Aug-2009 Cynthia Wong <cynthiaw@google.com> Take the account into account too when we are deleting and updating DATA.
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
e2579e029472f76b2dfda141444d775c67da0ec8 28-Aug-2009 Cynthia Wong <cynthiaw@google.com> Use the account name and type when we are doing update and deletes on contacts in the provider. Added a test for the delete case.
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
c76d0a78fe2d3471195cfa555bab016eec154f07 28-Aug-2009 Jeff Sharkey <jsharkey@android.com> Include STARRED in Entity, trigger dirty when touched.

Include RawContacts.STARRED column in Entity projection and
set DIRTY flag when starred is changed. We otherwise don't
trigger dirty, since the other fields aren't important to
sync--for example, TIMES_CONTACTED.

Helps fix http://b/2079148
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
023b9437a3644e59309b8cfd12c6d84b98433f95 28-Aug-2009 Dmitri Plotnikov <dplotnikov@google.com> Avoiding more unneccessary calls to markForAggregation
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
421782cb554e5050cf62a86b98df6520038dcd15 28-Aug-2009 Dmitri Plotnikov <dplotnikov@google.com> Avoiding unneccessary calls to markForAggregation
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
ff2de103f7e3eeeff4665ef63f07460fef053d6d 27-Aug-2009 Dmitri Plotnikov <dplotnikov@google.com> Removing "summary"-style URIs.

We will determine whether to include Presence by looking at the requested projection.
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
cabac02a2416b495e030654accffcbb5ae526678 27-Aug-2009 Dmitri Plotnikov <dplotnikov@google.com> Solving aggregation of dissimilar names by parsing them explicitly.
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
0b30cac29514b3978896731ba1df6a54fc94e9e4 27-Aug-2009 Dmitri Plotnikov <dplotnikov@google.com> Fixing a bug where changing/adding a phone number on the web would not be reflected on the phone.
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
8e45e5f2142db78941b095f7418cc05b71668094 26-Aug-2009 Dmitri Plotnikov <dplotnikov@google.com> Several changes in Contact Aggregation logic:

- The first request to aggregate will run immediately. The accumulation will only begin if
the following request shows up within 1/2 sec
- Reaggregation will no longer remove and reinsert Contacts. Once created, it will keep
the aggregate contact record. The only situations when it will be deleted is a join or
removal of all constituent raw contacts.
- Data updates and deletes will now trigger Contact update to keep names, photos etc
in sync with the constituent data.
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
61efab87c2c8166b3cd69ed1a908d1c0d7271d0b 25-Aug-2009 Dmitri Plotnikov <dplotnikov@google.com> [Issue 2074490] Adding legacy support for getType
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
b3f909fee75cb384fc381ec5ce70dd001669f945 24-Aug-2009 Dmitri Plotnikov <dplotnikov@google.com> Support for Global Search Shortcut refresh and contact images.
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
14bba94bbe0f2e215ad7b3b9417754a1ba0d95bf 25-Aug-2009 Dmitri Plotnikov <dplotnikov@google.com> [Issue 2072020] Updating name lookup tables when structured name, email, nickname are updated.

This is also an optimization: we will no longer be rebuilding
name lookup structures over and over again as a contact gets updated
and aggregated.
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
68936cefd4caa779169ea00ffd1adc399e634c9b 25-Aug-2009 Jeff Sharkey <jsharkey@android.com> Correct counts for ungrouped contacts.

Was joining and counting all ungrouped RawContacts instead
of counting aggregated Contacts instead.
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
ac004680e3cc127b6ebf32b78d2813654b9c56fb 25-Aug-2009 Jeff Sharkey <jsharkey@android.com> Trigger update of IN_VISIBLE_GROUP when inserting Group.

Also fix minor bug where we didn't persist dirty flag set
in updatedValues.
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
653f73c9417ee0d2cf90e9aacd32848016747cf7 22-Aug-2009 Dmitri Plotnikov <dplotnikov@google.com> [Issue 2065658] Editing a phone number now updates phone lookup table

... and some optimizations
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
e84f2475ec53a588c8c3461d28d3d8654ee74010 23-Aug-2009 Jeff Sharkey <jsharkey@android.com> Don't include a column that doesn't exist.
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
e07913c61c320b0cc2036db3b714e39534d8cd7a 21-Aug-2009 Jeff Sharkey <jsharkey@android.com> Add support for visibility of ungrouped contacts.

Built a tricky UPDATE query to determine the visibility of
any Contact by using any GroupMembership entries, otherwise
fall back to Settings.UNGROUPED_VISIBLE.
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
4dcd106ccc27dbbfaae86baf0cd57beb42c27ccc 21-Aug-2009 Dmitri Plotnikov <dplotnikov@google.com> Cleaning up Presence API
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
3653cf1fa8fb36a96a7e4a6ebd615438877c3183 21-Aug-2009 Dmitri Plotnikov <dplotnikov@google.com> Adding a "Photo" directory under Contacts.
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
e46667e641cd1c60998e1ccab4b60531d5b12ef7 21-Aug-2009 Dmitri Plotnikov <dplotnikov@google.com> Introducing AGGREGATED_PRESENCE - thanks to JSharkey for the idea.

This new DB table is maintained in memory and summarizes the presence
status and custom status for each (aggregate) contact. With the help
of this table, we avoid having to do GROUP BY and MAX(status) when
running contacts summary queries. An added benefit is that
we can now get the latest custom status update as part of the
summary query.
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
038c3db1b54dd9313c10c212025d37ca8a9e660f 21-Aug-2009 Fred Quintana <fredq@google.com> add the reset() method to EntityIterator
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
a6def2055f5d12cb6ee5cc3dc1adaf39f2b7c97c 21-Aug-2009 Dmitri Plotnikov <dplotnikov@google.com> Support for data_with_presence URI
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
19a0962e62c13a5e5f8e5b4eed5e30d3477894b4 21-Aug-2009 Dmitri Plotnikov <dplotnikov@google.com> Support for phones_with_presence URI
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
6f7446a25ecb55ee213eaa7702837cdf32e68777 20-Aug-2009 Dmitri Plotnikov <dplotnikov@google.com> Contacts: "non-existent account type".

Providing a "non-existent account type" instead of
an exception when there is no default account on the phone.
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
e3eb7ef438010c893c429f3031dcc7298171865d 19-Aug-2009 Dmitri Plotnikov <dplotnikov@google.com> Completing implementation of phone lookup API.
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
2971716e6a68660721d45be97bf3bd2dfad1c5ef 19-Aug-2009 Fred Quintana <fredq@google.com> add support for deleting groups and rawcontacts by a selection string
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
eb9ffdccfa19f5b2f22e688f733fd77e39605f9e 17-Aug-2009 Jeff Sharkey <jsharkey@android.com> Bring back per-Account Contact-specific settings.

These are used for two purposes: a flag indicating the
default sync state for Groups to inherit, and a flag that
marks when Contacts that don't belong to any specific group
should be visible in UI.
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
df9fd6b239de5829b04cb413e4dfa3e6da649c38 17-Aug-2009 Fred Quintana <fredq@google.com> fixup after merge from master
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
38446bf47c5ee2080df69f5fc8a33ad2fa3e61b5 17-Aug-2009 Jeff Sharkey <jsharkey@android.com> Bring back SHOULD_SYNC flag, expose CONTACT_ID in entities.

The frist allows sync groups to be edited, and the second
is used when editing contacts to know which aggregate ID to
strongly bind the new RawContact to.
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
ff065d085b794a0bf4be4cf6e87a67bf060e0319 15-Aug-2009 Dmitri Plotnikov <dplotnikov@google.com> Using a latch instead of semaphores.
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
568904d1cc9acfabac78b6fcbf8a7d5115688174 14-Aug-2009 Dmitri Plotnikov <dplotnikov@google.com> do not merge: cherry-picked d326974ca339cef284cc045c61d340ddb60d08da from master branch
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
013a0d6b3d392fb49d4618f2527b2ed3fec7d34f 13-Aug-2009 Dmitri Plotnikov <dplotnikov@google.com> Contact import optimization: using direct inserts into the database.
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
11944a13b31aa7c98f1079697f24b3a1999ca571 13-Aug-2009 Dmitri Plotnikov <dplotnikov@google.com> Aggregation optimization: email lookup, name lookup, phone lookup
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
88e5f4d32aa9cd3af0ac9654de479f1b8113f712 12-Aug-2009 Dmitri Plotnikov <dplotnikov@google.com> Fixing Data deletion logic
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
f992bfab334b760d36a053fc0b439382dcfb51ad 12-Aug-2009 Dmitri Plotnikov <dplotnikov@google.com> Removing handling of primary phone/email on Contact.

Adding code to compute HAS_PHONE_NUMBER on a Contact.
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
de955f25491cdc0e826ea5c7d4cd0e93cb970fb7 11-Aug-2009 Dmitri Plotnikov <dplotnikov@google.com> Proper transaction handling in ContactsProvider2
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
caa1cf4ef062f163ac5e370cebc0e47b5ae7460e 11-Aug-2009 Dmitri Plotnikov <dplotnikov@google.com> Fixing several issues of legacy support:

1. Security constraints fully enforced.
2. Default account is used for all operations.
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
73776ffd5c00e94db987ee30864e9c7a8396d22d 11-Aug-2009 Dmitri Plotnikov <dplotnikov@google.com> DIRTY flag on Contacts will no longer be set if the query has the ?mark_as_dirty=true parameter.

Sync adapters should be able to set their own data on the Data row without
triggering another round of syncing.
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
94021b213e4db367f60b30fcbfe9019e28571784 10-Aug-2009 Fred Quintana <fredq@google.com> add the deleted flag to the groups table
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
d659078547c329b58f90d8809910a845d913dbc6 10-Aug-2009 Dmitri Plotnikov <dplotnikov@google.com> Using LIMIT instead of MAX_SUGGESTIONS
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
99a9b5ec879f6cd6876f7f6b680b82d8304e6b92 08-Aug-2009 Dmitri Plotnikov <dplotnikov@google.com> Fixing an exception produced by the Display Groups UI.
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
4a023070dab9a069be4cac5f5ba5554b66238484 08-Aug-2009 Dmitri Plotnikov <dplotnikov@google.com> Hiding security constraints in SQL VIEWS - first cut.

This CL serves two purposes:
1. We hide the restriction checking inside SQL VIEWs, which will prevent security attacks like passing ") OR(1" for selection
2. We gain the ability to use unqualified column names in selections - all columns on a VIEW have unique names.
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
7a4550f2afb24b2112b6c937f416c6f46ece35f4 06-Aug-2009 Fred Quintana <fredq@google.com> - add some missing columns to some projections and views
- return IllegalArgumentException instead of a RuntimeException
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
00ec508630251d6c6e3746469c9428f5a8cd5996 05-Aug-2009 Jeff Sharkey <jsharkey@android.com> Fix column map naming, empty projection behavior.

The "MAX(mode)" projection needed to be named as the
expected column to be useful. The default behavior of
assertContained when asking for no specific columns
(projection=null) should be to /not/ limit to just that
single column. And finally, fix up one place where the
protection clause was being appended wrong.
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
3d8b043c3341a5b6c2e781b7eba9767d5cd13267 05-Aug-2009 Dmitri Plotnikov <dplotnikov@google.com> Contact conversion script, initial cut
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
321afd997c985f150a13e0a5538e2a12b755b217 28-Jul-2009 Fred Quintana <fredq@google.com> - test that query entities works
- add a view for the contacts entities query to hide the internal column names from user-provided where clauses
- fix a bug that keeps updates of a data row by id from working
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
3cfe8d532d509fbbe605454e3a32b2361b7e1501 04-Aug-2009 Dmitri Plotnikov <dplotnikov@google.com> Adding columns SYNC1-4 and fixing tests.
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
a908fb5f39aa2021662a6cc317cc7e4db2d8bfb0 04-Aug-2009 Dmitri Plotnikov <dplotnikov@google.com> Breaking global search support into a separate class and limiting search results to visible contacts only.
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
0c83a3c4b6a9c8a0dfa0b3aa2af91b74d8e3304f 03-Aug-2009 Evan Millar <emillar@google.com> Fix some missed naming conversions
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
b79160e642fca12222ca2bd2b8936a73f83d5e12 02-Aug-2009 Jeff Sharkey <jsharkey@android.com> Remove COUNT(*) from projection, was breaking tests.
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
a01e50cb1a5dd21293f8a8fe43f3fe0bf6349164 31-Jul-2009 Jeff Sharkey <jsharkey@android.com> Fix IM constants to match framework change.
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
c70dc0e38ff82c6e6d6b7458637c54fbdf446aac 31-Jul-2009 Dmitri Plotnikov <dplotnikov@google.com> Reimplementing global search integration in ContactsProvider2.

Also fixing bugs in the area of logical deletion of raw contacts and their exclusion from further aggregation.
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
2815f58f72f109790585931f601a63ddc02536a5 30-Jul-2009 Evan Millar <emillar@google.com> Adds URI for querying Contacts joined with RawContacts.
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
f1ce2d5008e490f447d6f5ff04a784c8ae066e9d 30-Jul-2009 Jeff Sharkey <jsharkey@android.com> Added COUNT(*) to support ContentProviderOperation.

Also added field to the Entity view, and correctly drop the
view during database upgrade.
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
226c3dc6e93ca76a84c99100caa31045cba06cf6 28-Jul-2009 Fred Quintana <fredq@google.com> - test that query entities works
- add a view for the contacts entities query to hide the internal column names from user-provided where clauses
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
d3fde755e73cd3912a488e7cb7d412d3c5f6ca94 28-Jul-2009 Dmitri Plotnikov <dplotnikov@google.com> ContactsProvider2: Renaming Aggregates to Contacts
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
373f7d2adc36680c31ff33e9ee12be865af6b5fb 28-Jul-2009 Dmitri Plotnikov <dplotnikov@google.com> Implementing Presence query.
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
5ef0401c311c62e53bde415b99cbb0ff83b0a9a2 28-Jul-2009 Dmitri Plotnikov <dplotnikov@google.com> ContactsProvider2: Renaming CONTACT_ID to RAW_CONTACT_ID
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
33b41fdb8d7c3c654cb070799c9d6e2b4ab16078 27-Jul-2009 Dmitri Plotnikov <dplotnikov@google.com> Implementing Raw Contact deletion.
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
6cffee46a1334d2b3ed19f436b27638451541044 27-Jul-2009 Dmitri Plotnikov <dplotnikov@google.com> Changing Contacts to RawContacts.

The renaming will be done in baby steps and in the
order of priorities.

Step 1: Contacts->RawContacts and deprecate Contacts
Step 2: Once all is converted, remove Contacts
Step 3: Aggregates->Contacts, including comments in the API
Step 4: Tables and fields
Step 5: Comments in the implementation code

Intermediate steps will be pretty ugly, but the result will be glamorous. I hope you are all still ok with "RawContacts"
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
445ca81effbb0d61c7bc0033acf2d3dfd228fd4e 25-Jul-2009 Dmitri Plotnikov <dplotnikov@google.com> Implementing compatibility mode for contact filtering
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
70b5ee6864cb3368d24a9e876fb93008997b12df 25-Jul-2009 Dmitri Plotnikov <dplotnikov@google.com> Compatibility support for Presence
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
20a94c86ede7380c8dd8df2f6a72b3c00ac1bed8 24-Jul-2009 Dmitri Plotnikov <dplotnikov@google.com> Fixing bulk update and delete of contacts data.
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
c62855331805c2744a097ef6ea625652197bfb87 24-Jul-2009 Dmitri Plotnikov <dplotnikov@google.com> Associating Presence with Contact as opposed to Aggregate.
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
d51a83ac4f8032b62d9a23b90a8f43d6b7eb2dbb 23-Jul-2009 Dmitri Plotnikov <dplotnikov@google.com> Adding SQL VIEWs to support backwards compatible WHERE clauses.
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
67dde51ab932dc84d95a203b113989b13437f13d 21-Jul-2009 Jeff Sharkey <jsharkey@android.com> Hard-coded IS_RESTRICTED exceptions, move to RES_PACKAGE.

The current RestrictionException API wasn't final enough to
reveal in the next platform release, and is only being used
by a single party. In addition, the original approach
required the sync adapter to assert any granted exceptions
during each update pass. There was also additional overhead
of watching for PACKAGE_ADDED and PACKAGE_REMOVED broadcasts
for clearing any applicable exceptions.

Finally, since this is a critical security element, we
really wanted to avoid storing the exceptions in another
SQL table that may be altered through an unknown SQL
attack vector. For now, the packages granted IS_RESTRICTED
access should be manually entered in sAllowedPackages.

This change also cleans up some projection mappings, and
minor fixed to prepare for a pending framework change.
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
e80e514a6175ad2ee03ea6eff6201e0e47d5a710 21-Jul-2009 Dmitri Plotnikov <dplotnikov@google.com> Adding compatibility support for ContactMethods and phone numbers.
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
3cebbf7141252768d3e272e049e9c5b0cb9d710e 17-Jul-2009 Dmitri Plotnikov <dplotnikov@google.com> Work in progress: introducing DataRowHandlers in ContactsProvider2.

1. Introducing DataRowHandlers
2. Adding DISPLAY_NAME to Contact for maintaining
a backwards compatible behavior
3. Implementing compatible DISPLAY_NAME behavior
4. Fixing handling of null display name
5. Implementing primary Organization
6. Implementing compatibility mode for Organization
7. Adding "delete" to compatibility support
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
9261b2141aa90a4fed632fd6da03026d4c216280 14-Jul-2009 Fred Quintana <fredq@google.com> - add the DIRTY and VERSION columns to the ContactsProvider2 Groups contract
- make the CP2 allow adding group membership rows with only a sourceid
in which case it will lookup the group row id, creating a group row
if necessary
- added test cases
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
f4e1358f1c8f5fe5e9e7689e36e04c57c2385169 15-Jul-2009 Dmitri Plotnikov <dplotnikov@google.com> Removing ContactOptions table.

1. Moving ContactOptions fields to Contacts.
2. Introducing AGGREGATION_MODE
3. Introducing Legacy API support
4. Implementing "last time contacted" update - for now just legacy requests.
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
b67163a1088f09c59f324350662eb18772fac6b6 15-Jul-2009 Evan Millar <emillar@google.com> Add Uri for filtering the aggregate summary on group name.

New Uri is:

content://com.android.contacts/aggregates_summary/group/*

Where * should be replaced by the group name.
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
ae6ca1f34cf5458d79ec803411d4308879a91e92 13-Jul-2009 Evan Millar <emillar@google.com> Chooses one photo to represent the aggregate.

This implementation simply chooses a random* photo from the first
account when sorted by account_name. We may want to make this more
intelligent before release.
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
35ed95769096bb5dd406ad7d1fcaa49a0e35a307 11-Jul-2009 Fred Quintana <fredq@google.com> make ContactsProvider2 create a syncstate table for use by sync adapters
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
035b4cc204be2641079a0b04e9ee9791a8f8248b 09-Jul-2009 Fred Quintana <fredq@google.com> remove the accounts table from the ContactsProvider2
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
28f8857b1b46bde18b85c6d3c2a63ac44c3c2e1c 08-Jul-2009 Evan Millar <emillar@google.com> Merge commit 'goog/eclair-dev' into merge3

Merged the new contacts content provider into goog/master. The old and
new content providers now live side by side under separate authorities.

Conflicts:
Android.mk
AndroidManifest.xml
res/values/strings.xml