History log of /packages/providers/ContactsProvider/tests/src/com/android/providers/contacts/SynchronousContactsProvider2.java
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
38210445730ee04c351c7cc1b3800cfe23e34325 27-Jun-2012 Makoto Onuki <omakoto@google.com> Reorganize import in contacts provider

Change-Id: If3afb134ea36bd93859efcd114885526e1592b91
/packages/providers/ContactsProvider/tests/src/com/android/providers/contacts/SynchronousContactsProvider2.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/tests/src/com/android/providers/contacts/SynchronousContactsProvider2.java
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/tests/src/com/android/providers/contacts/SynchronousContactsProvider2.java
583b1364980fd46a5012825886af3160752ff19c 29-Mar-2012 Makoto Onuki <omakoto@google.com> Make unit tests not crash

Workaround for "Cursor window allocation of 2048 kb failed" during
ContactAggregatorTest.

This should be some kind of OOM because if I run only ContactAggregatorTest
it passes without a crash.

Couldn't figure out the root cause. Instead of spending too much time on it,
decided to mark move all large tests except for ContactsProvider2Test to
medium.

Also did some cleanup for SynchronousContactsProvider2 and
SynchronousProfileProvider.

Bug 6249848

Change-Id: I51d80db1e4025ff20642bc3abf8074f882da47d8
/packages/providers/ContactsProvider/tests/src/com/android/providers/contacts/SynchronousContactsProvider2.java
9b626252d91e451a822f48cd127aef5d609a6257 07-Mar-2012 Makoto Onuki <omakoto@google.com> Don't manually close the database.

Don't close and reopen the database in CDH.getWritableDatabase().
The reason we did this was to sqlite reload the sqlite_stat1 table,
but according to the document running "ANALYZE sqlite_master"
should be suffice. (See http://www.sqlite.org/lang_analyze.html)

Also don't close the database helpers after upgrade in
ContactsUpgradeReceiver. We don't have to do this.

Also, replaced the test-only constructors of the helpers with methods
with more explicit name, in order to make sure only the singleton
instances are used in the main code.

Bug 6104842

Change-Id: I76a7d1b8f7b6462b97f627d722feaa03967cb18f
/packages/providers/ContactsProvider/tests/src/com/android/providers/contacts/SynchronousContactsProvider2.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/tests/src/com/android/providers/contacts/SynchronousContactsProvider2.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/tests/src/com/android/providers/contacts/SynchronousContactsProvider2.java
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/tests/src/com/android/providers/contacts/SynchronousContactsProvider2.java
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/tests/src/com/android/providers/contacts/SynchronousContactsProvider2.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/tests/src/com/android/providers/contacts/SynchronousContactsProvider2.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/tests/src/com/android/providers/contacts/SynchronousContactsProvider2.java
43368a3f9e05a979e454e278d6a0e8475f08923d 13-Jul-2011 Dave Santoro <dsantoro@google.com> Provider and DB changes to support data_set field.

The intent of the data set field is to provide a way for multiple
sync adapters from the same account name + type to manage separate
sets of data in the raw_contacts and groups table.

For example, this would allow for Focus groups to be synced in from
Focus via the Google Contacts sync adapter, and for Google+ Circles
to be synced in from the Google+ app, even though both are tied to
the same account name + type.

Bug 5077096

Change-Id: I641c5d233d8d4d70988d209179c4e79bdb9c7ea1
/packages/providers/ContactsProvider/tests/src/com/android/providers/contacts/SynchronousContactsProvider2.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/tests/src/com/android/providers/contacts/SynchronousContactsProvider2.java
ed78fd6df5e9f3a2d572162e5d374d1f4a625bdd 03-Dec-2010 Dmitri Plotnikov <dplotnikov@google.com> Fixing broken tests (proguard issue)

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

Bug: 3228684
Change-Id: I7fab53092dbf55ebb502bc5d4d2012c88842c8b8
/packages/providers/ContactsProvider/tests/src/com/android/providers/contacts/SynchronousContactsProvider2.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/tests/src/com/android/providers/contacts/SynchronousContactsProvider2.java
89ea0fad8212b989e0f64e8b07da2bf642b45d83 30-Nov-2010 Dmitri Plotnikov <dplotnikov@google.com> Fixing DirectoryTest

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

Change-Id: I76da184b794ea7727b9109e693fbf8834c9450b6
/packages/providers/ContactsProvider/tests/src/com/android/providers/contacts/SynchronousContactsProvider2.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/tests/src/com/android/providers/contacts/SynchronousContactsProvider2.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/tests/src/com/android/providers/contacts/SynchronousContactsProvider2.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/tests/src/com/android/providers/contacts/SynchronousContactsProvider2.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/tests/src/com/android/providers/contacts/SynchronousContactsProvider2.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/tests/src/com/android/providers/contacts/SynchronousContactsProvider2.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/tests/src/com/android/providers/contacts/SynchronousContactsProvider2.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/tests/src/com/android/providers/contacts/SynchronousContactsProvider2.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/tests/src/com/android/providers/contacts/SynchronousContactsProvider2.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/tests/src/com/android/providers/contacts/SynchronousContactsProvider2.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/tests/src/com/android/providers/contacts/SynchronousContactsProvider2.java
4e8ced99f8bbb01abd610a6ca60afcabb6ffe737 01-Oct-2009 Dmitri Plotnikov <dplotnikov@google.com> [Issue 2156901] Fixing update of the "starred" flag on raw contacts

Change-Id: I737a6e1a428edaa16c108bbbf5d4a461035560d4
/packages/providers/ContactsProvider/tests/src/com/android/providers/contacts/SynchronousContactsProvider2.java
c76cdd0723b99f478c9ba5329d14a971cd8dfb3d 30-Sep-2009 Costin Manolache <costin@google.com> Remove GAIA string
/packages/providers/ContactsProvider/tests/src/com/android/providers/contacts/SynchronousContactsProvider2.java
b38ed2c5ffeb20efc677b4a9229db4a00603aa8d 29-Sep-2009 Dmitri Plotnikov <dplotnikov@google.com> Renaming OpenHelper to ContactsDatabaseHelper

Change-Id: Iccdf1ebcd8a3ab430941c957f712bb9e7dd2706c
/packages/providers/ContactsProvider/tests/src/com/android/providers/contacts/SynchronousContactsProvider2.java
81d6a78dffd57f24f9aaecb6cd54e4084c3c9846 11-Sep-2009 Dmitri Plotnikov <dplotnikov@google.com> Reducing unnecessary triggering of sync adapters by ContactsProvider2

Change-Id: I280cd6d96a76e8df151ddb43b0f1b783501c4373
/packages/providers/ContactsProvider/tests/src/com/android/providers/contacts/SynchronousContactsProvider2.java
c1778ef6fa53b6bf08fd715b3ad70c052c5f1ce9 10-Sep-2009 Dmitri Plotnikov <dplotnikov@google.com> [Issue 2102836] Fixing the false positive aggregating on multiple secondary matches
/packages/providers/ContactsProvider/tests/src/com/android/providers/contacts/SynchronousContactsProvider2.java
285b771bc955305fa6d49ca23f808cecc8a13d5e 03-Sep-2009 Dmitri Plotnikov <dplotnikov@google.com> [Issue 2092543] Making manually created contacts show in the list immediately.
/packages/providers/ContactsProvider/tests/src/com/android/providers/contacts/SynchronousContactsProvider2.java
88d964d42c8b5392540f1c451d500f4587f6d300 27-Aug-2009 Dmitri Plotnikov <dplotnikov@google.com> Fixing aggregation performance test
/packages/providers/ContactsProvider/tests/src/com/android/providers/contacts/SynchronousContactsProvider2.java
11944a13b31aa7c98f1079697f24b3a1999ca571 13-Aug-2009 Dmitri Plotnikov <dplotnikov@google.com> Aggregation optimization: email lookup, name lookup, phone lookup
/packages/providers/ContactsProvider/tests/src/com/android/providers/contacts/SynchronousContactsProvider2.java
2482dd0309794d57233d0af37a7c12fc647e7bf9 12-Aug-2009 Dmitri Plotnikov <dplotnikov@google.com> Aggregation optimization: updating all Contacts attributes with a single pass over raw contacts.
/packages/providers/ContactsProvider/tests/src/com/android/providers/contacts/SynchronousContactsProvider2.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/tests/src/com/android/providers/contacts/SynchronousContactsProvider2.java
3d8b043c3341a5b6c2e781b7eba9767d5cd13267 05-Aug-2009 Dmitri Plotnikov <dplotnikov@google.com> Contact conversion script, initial cut
/packages/providers/ContactsProvider/tests/src/com/android/providers/contacts/SynchronousContactsProvider2.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