summaryrefslogtreecommitdiffstats
path: root/src/com/android/providers/contacts/VoicemailContentTable.java
Commit message (Collapse)AuthorAgeFilesLines
* Fix read voicemails being marked as "new".Nancy Chen2015-06-231-1/+1
| | | | | | | | Originally was comparing content values with "1" but some other sources use "true", check for boolean value instead of integer value. Bug: 21281858 Change-Id: I0124311ba7343826d094c621e6b2899053d6dabf
* Set Calls.NEW to 0 if the voicemail is read.Nancy Chen2015-06-081-2/+4
| | | | | | | | | Newly inserted read voicemails were notifying because the Calls.NEW flag was set to true. Add logic to set it to false if the Voicemails.IS_READ flag is set to true. Bug: 21085233 Change-Id: Ibb969de54684578473b7617095b63dd04c953abc
* Add phone_account_* fields to voicemail content table allowed columns.Nancy Chen2015-04-021-0/+4
| | | | | | | | | | | | This allows updating and querying of voicemail entires for their respective phone account columns. Update tests to reflect this change: - Increase number of voicemail columns to 18 - Add phone_account_* fields to update test Bug: 19236241 Change-Id: I16b3c9d2a74bc7e169de4dd108b39b94acc98c4f
* Upgrade voicemail_status and calls tables for visual voicemail.Nancy Chen2015-03-021-0/+4
| | | | | | | | | | | Do a database upgrade for MNC in order to add multi-SIM fields to the voicemail_status table and add "dirty" and "deleted" fields to voicemails table. Add functionality in DbModifierWithNotification to handle "dirty" and "deleted" appropriately. This new functionality is tested in VoicemailProviderTest and CallLogProviderTest. Bug:19236241 Change-Id: I25ebba0bdb5f720e48beaf17dbdd2846e494da74
* Add TRANSCRIPTION column to Calls tableYorke Lee2014-07-151-0/+2
| | | | | Bug: 10928782 Change-Id: I8e0e53e3c746baa64dd868a0e1c57444e2050578
* am 84acbc81: am e2688b18: am 44c3d51b: am 13d744f2: am 466d8411: am ↵Chiao Cheng2013-07-231-0/+1
|\ | | | | | | | | | | | | 8d54a6e0: resolved conflicts for merge of b8fb609b to jb-mr1-dev * commit '84acbc81b50e8d30df668b4ffd763b7c96e172a2': Do not allow updates to the _data column.
| * resolved conflicts for merge of b8fb609b to jb-mr1-devChiao Cheng2013-07-221-1/+19
| |\ | | | | | | | | | Change-Id: I336ee0b3f041f83a4b4e2c9973abb73852c2cc6f
| | * Do not allow updates to the _data column.Chiao Cheng2013-07-121-1/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fixes a security hole where applications can update the data location of voicemail files to point to arbitrary file paths. Voicemail provider stores the location of the data file in the _data column. Applications can update this with an arbitrary file path as long as they have the ADD_VOICEMAIL permission. Then they can subsequently read that voicemail and obtain access to the file. This location is generated by the provider and does not need to be updated by the applications. Bug: 9674953 (cherry picked from commit ab2a24c126f35ae4aefb469f91094e5972abd8f0) Change-Id: I6c795fe8e283f60f71ebc0e53606383c9fd22e71
* | | Do not allow updates to the _data column.Chiao Cheng2013-07-121-1/+20
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | Fixes a security hole where applications can update the data location of voicemail files to point to arbitrary file paths. Voicemail provider stores the location of the data file in the _data column. Applications can update this with an arbitrary file path as long as they have the ADD_VOICEMAIL permission. Then they can subsequently read that voicemail and obtain access to the file. This location is generated by the provider and does not need to be updated by the applications. Bug: 9674953 Change-Id: I9c8fc45071a06d627574a52bafbd9e6e172b4bf8
* | Reorganize import in contacts providerMakoto Onuki2012-06-271-4/+4
|/ | | | Change-Id: If3afb134ea36bd93859efcd114885526e1592b91
* Moving ProjectionMap to frameworks/ex.Dave Santoro2011-12-131-0/+1
| | | | Change-Id: I3ccd0dd27ff0fe49ac54574449264c2e957d3a01
* Use integer constant when adding filtering clause.Flavio Lerda2011-11-151-1/+1
| | | | | | | | | | Currently we are quoting an integer constant when generating the filtering clause that excludes voicemails from the set of calls returned to applications querying the default call log URI. Pass the integer to the helper function, so that we can avoid quoting. Change-Id: I1e460d2c8d3b04047cf4a1f4e1209b3e4ba5053b
* Fix voicemail tests.Flavio Lerda2011-09-051-1/+3
| | | | | | | | | | | | The problem is that we run this query locally (within the same process) in the tests and this means that the content values passed in were modified and later re-used (assuming it would not contain the extra, generated columns). The solution is to always make a copy of the content values before modifying them in the provider (which is the safest way anyway). Bug: 5226211 Change-Id: I972111821a4af1e1d3df2dc47189d664a7303683
* Voicemail provider: Don't automatically set HAS_CONTENT field.Debashish Chatterjee2011-08-111-8/+1
| | | | | | | | | | | It is best to let the content owner set this field when it is finished writing the content into the file. Another change will modify the voicemailproviderdemo app to set this field in the app. Bug: 5147190 Change-Id: I93e4b467acdefe339fa70dd751ea05f195c32e71
* Notify callog uri if a change is made through voicemail provider.Debashish Chatterjee2011-08-101-2/+1
| | | | | | | | | | | | | | | | DbModifierWithVmNotification till now only notified to voicemail uri content observers for change made through call log provider. We need the otherway round as well so that any change made to a voicemail entry through the voicemail provider should be notified to listeners of calllog uri. This is needed to make call log auto refresh work when a new voicemail is inserted. DbModifierWithVmNotification is now renamed to DbModifierWithNotification and suports both ways notification. Notifications generated by call log provider as well is now routed through this class. Bug: 5055868 Change-Id: I2de8c9867445bcb86ce94a8600acc726266c8008
* Automatically add a geocoded location to entries in the call log.Flavio Lerda2011-08-101-1/+5
| | | | | | | | | | | | This change adds a geocoded location value to entries added to the call log. One limitation is that this is unaware of changes to the locale. We needed to decide whether this is fine or if we should update the stored geocode on locale changes. Bug: 5129581 Change-Id: I2ad1b3fbd24491df2febf3e1fd615c16dd74398f
* Modified VoicemailContentProvider to set Calls.NEWDebashish Chatterjee2011-08-081-0/+4
| | | | | | | | | | Calls.NEW is now an internal field for the voicemail interface and so the content provider must set it to '1' for new voicemail insertions. Contacts app now depends on this field to show notifications. Bug: 5055868 Change-Id: Ic76501fa3a4361f1fce278247295d0bbe2f1f4c8
* Don't crash deleting a voiceamil with no file.Hugo Hudson2011-08-041-1/+6
| | | | | | | | - The file constructor wasn't happy with null. - Instead log a warning and carry on. Bug: 5120418 Change-Id: I6d83c34dbea828b560674c065b45a1eb04b07ee6
* Add synthetic columns to voicemail table.Hugo Hudson2011-08-021-17/+32
| | | | | | | | | | | | - Since our voicemail table supports getInputStream and getOutputStream we should also support the columns for DISPLAY_NAME and SIZE, since these are expected to exist for helping other apps share files - attaching to an email in GMail for example. - Uses an SQL hack to combine a suitably localized string with the number column for the display name. Bug: 5066115 Change-Id: I48a08ade2a3a2a28a1d3e3415ec27dd956056d44
* No more use audio mime type for voicemail uris.Debashish Chatterjee2011-07-291-24/+3
| | | | | | | | | | | | | | 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
* Merge "Improvements in voicemail broadcast notifications."Debashish Chatterjee2011-07-271-36/+9
|\
| * Improvements in voicemail broadcast notifications.Debashish Chatterjee2011-07-261-36/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-1/+0
|/ | | | | | | | | | | | | | | 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
* Implement IS_READ column in content providers.Flavio Lerda2011-07-251-0/+1
| | | | | | | | | | 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
* VoicemailStatus content provider implementation.Debashish Chatterjee2011-07-081-18/+9
| | | | | | | | | | | | | - 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
* Refactored VoicemailContentProvider to simplify using multiple tables.Debashish Chatterjee2011-07-061-0/+289
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