summaryrefslogtreecommitdiffstats
path: root/tests
Commit message (Collapse)AuthorAgeFilesLines
* Merge "Delete voicemail data when source package is uninstalled."Debashish Chatterjee2011-08-033-161/+301
|\
| * Delete voicemail data when source package is uninstalled.Debashish Chatterjee2011-08-013-161/+301
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The deletion of voicemail data for the uninstalled package is done through a service. The PackageIntentReceiver just forwards the package removal intent to the service after sanity check that the intent is really for an uninstalled package. The logic to check whether the intent should trigger a clean up is repeated in VoicemailCleanupService as well. This provides an extra safety net and and also lets the unit test cover this functionality. Bug: 5056159 Change-Id: Id7315a1318d510b50878f26c2e0d380c1920ee4e
* | Merge "Create account record if needed on profile insert."Dave Santoro2011-08-011-0/+17
|\ \ | |/ |/|
| * Create account record if needed on profile insert.Dave Santoro2011-08-011-0/+17
| | | | | | | | | | | | | | | | | | | | | | | | For accounts without a data set, this should be handled automatically when the account is added. But with data sets, we need to handle it specially so that the profile raw contact ID reference has a row to hang off of. Other raw contacts or groups with a data set will have the account record created in the background when the provider is initialized. Change-Id: I24ea0c389c3bc839aee295f1297e2236c473d66f
* | No more use audio mime type for voicemail uris.Debashish Chatterjee2011-07-291-6/+6
|/ | | | | | | | | | | | | | This makes the uri handling simpler, as we voicemail uris can now only be of item or dir and does not depend on the content. This also avoids strict mode violation when getType is called from UI thread. There is no change needed in the contacts app because the URI mime type is right now used by the app. Bug: 5090052 Change-Id: Ie2e502f9b09465dc343e873d43e206aaad8b6076
* Fix VoicemailProviderTest.Debashish Chatterjee2011-07-291-0/+5
| | | | | | | | | Modified MockPackageManager to stub checkPermissions. This method was recently used in production code in Change-Id: I20982572d7f9a08ce98b03b23c9d2d8aa60efc9f but I missed to update the Mock. Consequently the tests now fail with unsupportedoperation exception.
* Merge "Return starred with phone number when phone-only"Daisuke Miyakawa2011-07-281-5/+16
|\
| * Return starred with phone number when phone-onlyDaisuke Miyakawa2011-07-271-5/+16
| | | | | | | | | | Bug: 5087645 Change-Id: Ib60353fd44c23566ae0d2cbaa695f5bbdfd26eb0
* | Provider and DB changes to support data_set field.Dave Santoro2011-07-272-2/+13
|/ | | | | | | | | | | | | | | 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
* Merge "Improvements in voicemail broadcast notifications."Debashish Chatterjee2011-07-273-9/+77
|\
| * Improvements in voicemail broadcast notifications.Debashish Chatterjee2011-07-263-9/+77
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This change fixes two primary issues: 1) If a voicemail record is modified through call log provider, a voicemail provider notification is now generated. 2) voicemail notifications are now sent with permission ALL if the receiving component packages is not the owner of the modified record. This ensures that a voicemail source (having OWN permission) gets notified only of changes for records that it owns. But a package that has ALL permissions get notified of everything, A new interface DatabaseModifier is now used by both voicemail as well as calllog provider to perform any operations that can modify the underlying table. DbModifierWithVmNotification implementation of this interface fires relevant notifications under the hoods. All logic related to sending notifications is now moved from VoicemailContentProvider to this new class. bulkInsert has no special treatment anymore. We now fall back to the framework's default implementation. It was complicated to optimize for provider_changed events for bulk insert when using the DatabaseModifier interface. TODO: I am yet to write unit tests for broadcast intents. I have done manual testing to make sure that they work. Also the existing unit tests pass, proving that none of the existing content provider operations are broken by using the DatabaseModifier wrapper. Bug: 5060354 Bug: 4974222 Change-Id: I0935105f146a71abeffbde634d79f8806b8e0ed2
* | Do not expose the NEW column in the Voicemail provider.Flavio Lerda2011-07-261-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We added the IS_READ column, so that we can distinguish between items that are new and items that have not been read (or heard, for voicemail). However, there is no reason to expose the NEW status of voicemail, since that is about whether the user should be notified and it is handled entirely by the content provider and Contacts application. This is part of the changes needed to fix notifications for voicemails. Bug: 5036195 Change-Id: I74d760a73d5ffbbb6eb26f2dbe7c7ca2a92ad2d6
* | Fixed VoicemailProviderTest.Debashish Chatterjee2011-07-261-1/+1
|/ | | | | | | | A recent change added a new 'IS_READ' field into the content provider but this test was missed to be updated for the number of columns expected out of the content provider. Change-Id: I03885e2b2ac827fe04e06e528e9ffd51823004ee
* Make frequent uri work correctlyDaisuke Miyakawa2011-07-251-2/+22
| | | | | | | Also add unit test for it Bug: 5073384 Change-Id: I7fa41f50883e14a84ef95d2b098379b1d6b47bae
* Implement IS_READ column in content providers.Flavio Lerda2011-07-252-1/+2
| | | | | | | | | | Add support for the IS_READ column in the call log and voicemail content providers. This columns will be used to store whether a call log entry (currently only voicemail) has been read or otherwise consumed by the user. Bug: 5036195 Change-Id: I06840f9820f7d568a738c0307f4294c2b8c66031
* 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-155-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-1312-49/+684
|\
| * Large photo storage.Dave Santoro2011-07-1312-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-155-26/+29
|/ | | | | | | | | | | | | 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-099-276/+748
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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