summaryrefslogtreecommitdiffstats
path: root/tests/src
Commit message (Collapse)AuthorAgeFilesLines
...
* Add group count capability and improve performanceDaisuke Miyakawa2011-07-241-36/+128
| | | | | | | | | | | | | - 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
* Add support for frequent uriDaisuke Miyakawa2011-07-221-5/+41
| | | | | | | Must be after Ia670229e4d3e793446b0a0dce2590e20709ee18c Bug: 5050315 Change-Id: I0ad08f65659987aefda20cd1f9fdfb0d375660f0
* Make strequent-phone-only returns what we wantDaisuke Miyakawa2011-07-211-39/+39
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - 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
* Forward-compatibility of old status update API.Dave Santoro2011-07-201-30/+86
| | | | | | | | | | | | | 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
* Fix malfunctioning bucketization logicDaisuke Miyakawa2011-07-181-0/+67
| | | | | | | | | | | | | | | | | | 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
* Photo aggregation logic update.Dave Santoro2011-07-152-0/+125
| | | | | | | | | | | 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
* Fix issue with profile checks during updateData().Dave Santoro2011-07-141-0/+22
| | | | | | | | | | | 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
* Merge "Large photo storage."Dave Santoro2011-07-137-49/+684
|\
| * Large photo storage.Dave Santoro2011-07-137-49/+684
| | | | | | | | | | | | | | | | | | | | | | | | 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
* | Fix the testsDaniel Lehmann2011-07-131-0/+4
|/ | | | | Bug:4413120 Change-Id: I796dc50d8e3e978098869fcb7fccd597a84c2e4a
* Remove restricted white-listingDaniel Lehmann2011-07-114-440/+12
| | | | | Bug:4974334 Change-Id: I4dd95089774373d2b67d7e14dc6b7fc40a92d094
* Merge "VoicemailStatus content provider implementation."Debashish Chatterjee2011-07-081-25/+165
|\
| * VoicemailStatus content provider implementation.Debashish Chatterjee2011-07-081-25/+165
| | | | | | | | | | | | | | | | | | | | | | | | | | - New Voicemail.Delegate implementation for voicemail_status table. - modified openFile() interface to simplify the interaction. - UridData now has a getWhereClause() method that can be used by both the tables to set selection clause based on the uriData. - Imrpoved permission checks for ContentValues for update/insert/bulkinsert operations. Bug:4968719 Change-Id: I6a6173c58d9929ef952c7d7e95afb8bc5ff4157b
* | Provider implementation of stream item API.Daniel Lehmann2011-07-073-0/+628
|/ | | | | | | | | | | | | | | | 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
* Refactored VoicemailContentProvider to simplify using multiple tables.Debashish Chatterjee2011-07-061-2/+50
| | | | | | | | | | | | | | | | | | | | This is needed to simplify the voicemail provider to be able to serve operations on the voicemail_status table as well. The idea is to retain all common functionality related to voicemail permission check etc in the main VoicemailContentProvider class. And delegate database level operations to another class that only deals with functionality speficic to the underlying table. In the favor of code reuse the interaction between voicemail_content_provider and voicemail_table_implementations is both ways. VoicemailTable interface defines the operations exposed by both sides. I have also added a couple of new test cases to cover getType() and source_package check in the uri. Old test cases continue to pass to prove that the refactoring did not break any functionality. Change-Id: I4cb031234c2f5746084c51557e2ba0edbaf3d6de
* Modified voicemail provider to accept source_package as a param.Debashish Chatterjee2011-07-041-10/+13
| | | | | | | Voicemail provider now no more supports /source/ path. Also stopped using deprecated fields of VoicemailContract. Change-Id: Ieab08781bca6ec571f29c56ca55d84a8fd18547b
* Send broadcast intents to specific component instead of package.Debashish Chatterjee2011-07-011-4/+6
| | | | | | | This avoids sending duplicate notification to the same package if it has more than components registered for the same broadcast. Change-Id: I93744aebc9a4800c5ce1fd60fb1468382f55934e
* Fixed VoicemailProviderTest.Debashish Chatterjee2011-07-011-1/+12
| | | | | | | | | | | A recent change in voicemail content provider used the package manager queryBroadcastReceivers() to query the receiving packages of the broadcast intent. However, mock package manager used in the test env does not support this operation and throws an exception. The fix is to wrap this method within the content provider implementation and stub the wrapper method in the test. Change-Id: Ief4887f1379614466ea6471cf7b132ef873550ba
* Use shared constants for call log with voicemails.Flavio Lerda2011-06-291-20/+17
| | | | | | | Use the shared constants for accessing voicemails in the call log. Remove the local copies in the content provider. Change-Id: I1c026ab604201b73e4f6a057a8b725479c72c796
* Use new data usage stat for strequent contactsDaisuke Miyakawa2011-06-282-19/+81
| | | | | | | | | | | | | | | | | 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
* Introduced query param 'include_voicemails' for call_log uri.Debashish Chatterjee2011-06-283-14/+179
| | | | | | | | | | - by default only call entries (i.e. no voicemails) are returned. - if include_voicemails is set to true then also include voicemail records, but only if the caller has full voicemail permission. - voicemail record can only be inserted through call_log provider if include_voicemails is set. Change-Id: I98f6778ace64fa752dc0525c5ce4e5eb83b2e689
* Renamed INCLUDE_PROFILE param to ALLOW_PROFILE.Dave Santoro2011-06-241-1/+1
| | | | | | Bug: 4777097 Change-Id: Ib254569f2595ae90e5ef72c1c4abcc7a5e45215b
* Prefer primary data to others.Daisuke Miyakawa2011-06-171-0/+35
| | | | | Bug: 4723377 Change-Id: Iaeb74924a8567d049adcd91dfa03814a63abf088
* Merge "Fix test breakage introduced in ICU upgrade."Daisuke Miyakawa2011-06-172-2/+74
|\
| * Fix test breakage introduced in ICU upgrade.Daisuke Miyakawa2011-06-162-2/+74
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - 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
* | Added checks in voicemail provider to not expose call_log fields.Debashish Chatterjee2011-06-174-7/+109
| | | | | | | | | | | | | | | | | | | | - Voicemail provider now has check to ensure that no field outside of its projection is accesible. - Moved functionality to check ContentValues against a projection map to DbQueryUtils. - Associated test cases. Change-Id: I23033c96f74f0ab981152f70e585c69ba5284602
* | Unit tests for voicemail provider.Debashish Chatterjee2011-06-161-0/+336
|/ | | | | | | | | | | These tests cover basic functionality of the provider including permission checks and media content input/output. The key functionality that is yet to be tested is provider change broadcast intents. This requires us to use a mocking framework, and we are yet to finalize on which one we will use. Change-Id: I2304309c4fc109cc1e0b969ede33d8268a4d4194
* Merge "Voicemail provider implementation within ContactsProvider."Debashish Chatterjee2011-06-162-0/+145
|\
| * Voicemail provider implementation within ContactsProvider.Debashish Chatterjee2011-06-152-0/+145
| | | | | | | | | | | | | | | | | | - New voicemail provider class - all voicemail operations restricted to only 'voicemail' call type. - new voicemail permissions (currently defined in the manifest file itself) Change-Id: I32b916c5b4a53e93bafbecf7df7bee3f5e27fee6
* | Fix LegacyContactImporterTestDaisuke Miyakawa2011-06-152-11/+14
|/ | | | | | | | | | | | | Need to update golden files per ICU version update. See also: I695558055cc139b42b71da9138f61d19bcbd9758 Also add some annotations for tests. Note that this doesn't fix every test. It looks the other test breakages are harder to resolve. Bug: 4645142 Change-Id: Ib487c28c3cd73dd702962e4590ada1a6319c2e50
* Introduced new voicemail fields in 'calls' table.Debashish Chatterjee2011-06-154-21/+136
| | | | | | | | | | | | | The 'calls' table is going to be shared between the existing call_log provider, and to be added voicemail provider. This change adds all the columns needed to support voicemail in the 'calls' table. The call_log provider, however, uses only one additional field 'voicemail_uri', whereas all other new fields will exclusively be used the new voicemail provider. The change also ensures that the voicemail provider specific fields are not exposed through the call_log provider. Change-Id: Ieea4b14052b7e7e9db0e674138772b4e06b3f074
* Introduce data usage table for per-method ranking.Daisuke Miyakawa2011-06-141-87/+48
| | | | | | | | | | | | - 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
* URIs and queries to support profiles.Dave Santoro2011-06-096-18/+469
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* am 37f0bdbb: Remove stale rows in directory table.Daisuke Miyakawa2011-06-031-0/+68
|\ | | | | | | | | * commit '37f0bdbb0a99b12abcc319f49a2caa5ab648add0': Remove stale rows in directory table.
| * Remove stale rows in directory table.Daisuke Miyakawa2011-06-021-0/+68
| | | | | | | | | | | | | | | | | | | | When upgrading from mr0 to mr2, we encounter some crashes on email compose. It is because BaseEmailAddressAdapter uses directory API, and the API has wrong resouce id in it. We need to remove rows which don't correspond to any directory provider. Bug: 4479240 Change-Id: Ife87a4a2ccad5d2a784eb5bd6ca56061a22c1787
* | Enable selection strict mode and sql injection testsDaniel Lehmann2011-06-011-0/+125
| | | | | | | | | | Bug:4368912 Change-Id: I3f854a54e402f366be9bc6712a6188b4537b990b
* | Fix wrong handling in getQueryParameter()Daisuke Miyakawa2011-05-051-0/+13
| | | | | | | | | | | | | | | | | | | | 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
* | Move snippet logic from DB to a cursor wrapper.Dave Santoro2011-05-022-10/+114
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | Add "primary account" support.Daisuke Miyakawa2011-04-062-1/+65
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | Use new interface for vCard exportDaisuke Miyakawa2011-03-171-29/+0
| | | | | | | | | | Bug: 4066223 Change-Id: Ie21c8966b0bb5b73b3afd18bfe7c142b523413c4
* | Use old version of vCard composition methodDaisuke Miyakawa2011-03-101-6/+1
| | | | | | | | | | | | | | Must be after I91b65f881e1712ecf82c2e119a92bc70c43c623c Bug: 4066223 Change-Id: I2667a91d90b1ce985a354a5a37de75bb8156cff8
* | Add test for vCard.Daisuke Miyakawa2011-03-041-0/+85
|/ | | | | | | | | | Need I0da5af56bf04e8eafbef376668a09002cb62d3f5 Very simple one. Definitely we need more, but this is first step anyway. Bug: 3156956 Change-Id: I715c2b14c5175f1ff46fd75cf6790262712d5bc2
* Preserving dot in name prefixes like "Mr." and "Prof."Dmitri Plotnikov2011-02-252-9/+9
| | | | Change-Id: Ife9324d8429961468a6ef3074feb374a63b989f0
* Displaying name prefix in the list and detail panelDmitri Plotnikov2011-02-252-13/+13
| | | | | Bug: 3488074 Change-Id: Ieb13337edbec01dcbd9581500420f47213f972e5
* Fix tests broken by proguardDmitri Plotnikov2011-02-221-2/+2
| | | | | Bug: 3466915 Change-Id: If506bba3142c7b8fd8ef3a8033693925f51da2ca
* Added a couple of regression testsDmitri Plotnikov2011-02-162-1/+38
| | | | | Bug: 3423385 Change-Id: I6d8ab5c8669b61d69152a3b2d3ba88ffa3fc6ce0
* Fixing a testDmitri Plotnikov2011-02-111-12/+15
| | | | Change-Id: I689d05ca96fb43cc7a57fcadc2dd27d6dd4f21b2
* Full text search: email suggestionsDmitri Plotnikov2011-02-111-2/+2
| | | | | | | Also, removing a bunch of dead code Bug: 2078420 Change-Id: I2c0a9ddd8e60624049b39ac018f87bfabc6574c2
* Full text search: Asian language supportDmitri Plotnikov2011-02-113-17/+117
| | | | | Bug: 2078420 Change-Id: I1a99ad05bb6e30b539134d60f669134b87dbf180
* Full text search: QSB supportDmitri Plotnikov2011-02-112-30/+30
| | | | | Bug: 2078420 Change-Id: I767ccecc856c0ae9ad74aafb3dac0de39b657e3c