History log of /packages/providers/ContactsProvider/tests/src/com/android/providers/contacts/VoicemailProviderTest.java
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
72ec7ff768c838bf4e69ffdcfb3976217610aba1 05-May-2017 mike dooley <mdooley@google.com> Fix unit tests

Fixing tests that broke when new database column, transcription_state
was added (ag/2129944, ag/2129909).

Test: ran ContactProvider unit tests
Bug: 37952129
Change-Id: Iec466dd40e83e6b91b336c479cf3919333a07781
/packages/providers/ContactsProvider/tests/src/com/android/providers/contacts/VoicemailProviderTest.java
f097acc6090efdc45d73c717eaaa73a1503206e2 14-Feb-2017 Ta-wei Yen <twyen@google.com> Merge "Fix VoicemailProviderTest for new columns" into nyc-mr2-dev
c4b2bcdf4cb3a7d3eed268cc60340173f3749cb6 23-Jan-2017 Ta-wei Yen <twyen@google.com> Fix VoicemailProviderTest for new columns

Test: VoicemailProviderTest
Bug: 34463609
Change-Id: Ic9c1963f084373f2d69090bee82de3e9f1bb438b
/packages/providers/ContactsProvider/tests/src/com/android/providers/contacts/VoicemailProviderTest.java
eb063d5cf7d957263d19f83400aa1eee5ef41020 20-Jan-2017 Ta-wei Yen <twyen@google.com> Merge "Add voicemail backup/restore columns" into nyc-mr2-dev
27bedb2f415f7bf33f351c6b2575a0087577c077 20-Jan-2017 Ta-wei Yen <twyen@google.com> Add voicemail backup/restore columns

BACKED_UP and RESTORED are required for dialer voicemail backup/restore
feature for N MR2. As there are no API bump the fields will be hidden
in NMR2. These fields will be made public in O.

ARCHIVED and IS_OMTP_VOICEMAIL is not used for NMR2, but added in
advance to avoid multiple database upgrades.

Test: VoicemailProviderTest
Bug: 34463609
Change-Id: I95ef21950337ca1f8bc79cc0493f7c302ec05617
/packages/providers/ContactsProvider/tests/src/com/android/providers/contacts/VoicemailProviderTest.java
687bef960a8309410ee1ba0da06a012914bef88e 08-Nov-2016 Ta-wei Yen <twyen@google.com> Prevent LAST_MODIFIED from changing after deletion

Previously LAST_MODIFIED is updated every time any modification is done
to a row, even if it is marked as deleted. A deleted row should not
be changed other then undeleting it, but it is hard to enforce this
on existing clients. Instead, LAST_MODIFIED will freeze at the moment
it was deleted.

In this CL, before the values are updated a separate query will update
LAST_MODIFIED for all rows that will be affected, unless it is already
marked as deleted. If a update will unmark the rows as deleted, a rows
will have its' LAST_MODIFIED updated.

Fixes: 31975372
Test: runtest contactsprov
Note: In the current master most of the contacts provider tests are
broken due to UserManager changed to use getApplicationContext()
on its' constructor, which is not mocked by the test context.
This CL is tested with the change reverted.

Change-Id: I7ce1e98fa14932c50e84bb9ef6b2549e93faddc4
/packages/providers/ContactsProvider/tests/src/com/android/providers/contacts/VoicemailProviderTest.java
21c692d49ce7ad6f9414d46ac2410d3f2e4c4d20 25-May-2016 Ta-wei Yen <twyen@google.com> Add SOURCE_TYPE field to VoicemailStatus table

+ Bump callog database version to 3

Bug:26944391
Change-Id: Ie4d7e67658247445c45f9f413902eda205bf2541
/packages/providers/ContactsProvider/tests/src/com/android/providers/contacts/VoicemailProviderTest.java
155ff44c5809da846b841011923b7e81dede303d 27-Jan-2016 Ta-wei Yen <twyen@google.com> Implement UPSERT for VoicemailStatusTable#insert

When putting data into the voicemail status table we used to have 2
separate database operations:
1) check if the index exists
2) insert into the database if not exist, or update if exists.
This is a potential race condition if 2 threads try to write at the
same time, pointed out in ag/838999

This CL solve it by changing the semantic of INSERT to "UPSERT",
"Update or insert", which is a single database operation of
"insert into the database if not exist, or update if exists"

SQLite does not directly support UPSERT, and doing so in a single
query is complicated. Instead insert, query, update, and delete in
VoicemailStatusTable is changed to be synchronized with a singleton, so there can only
be one thread doing a set of operations on the table at once.

Large traffic on VoicemailStatusTable is unlikely so the synchronization
cost is acceptable.

Bug:26451384
Change-Id: I6c03bd2720cbb05738cb3059fd19d65156244e20
/packages/providers/ContactsProvider/tests/src/com/android/providers/contacts/VoicemailProviderTest.java
dc653a5c1bed274512ce41e4a6129a65d2b0eeac 22-Dec-2015 Makoto Onuki <omakoto@google.com> Move CallLog and VoiceMailStatus to their own DB.

- Move the "calls" and "voicemail_status" tables to the new
"calllog.db" database.

- Migrate all data into it.

- Remove the old tables in contacts2.db

- VoicemailContract.Status.SOURCE_PACKAGE is no longer UNIQUE

Bug 26247586

Change-Id: I003d49b8fb150c21a34830bc62e8c816ce2cd8cd
/packages/providers/ContactsProvider/tests/src/com/android/providers/contacts/VoicemailProviderTest.java
6a7519df9e4462bfc02f28f0b066280307541905 21-Dec-2015 Ta-wei Yen <twyen@google.com> Fix CallLogProviderTest

Test cases has not been updated for a while.

+ Check userHandle == USER_SYSTEM and isManagedProfile() instead of
isSameProfileGroup() in syncEntriesFromPrimaryUser().
+ Check LAST_MODIFIED for CRUD operation on Calls table.
+ Calls.ADD_FOR_ALL_USERS = 1 defaulted to getTestCallLogValues()

Change-Id: I19a10e5a26951dae69a1481f142d6c398b56e09a
/packages/providers/ContactsProvider/tests/src/com/android/providers/contacts/VoicemailProviderTest.java
52cb1f8391fdf93ad90d675585a9c7e385e4a8d6 14-Dec-2015 Ta-wei Yen <twyen@google.com> Add QUOTA_OCCUPIED and QUOTA_TOTAL to VOICEMAIL_STATUS table.

Add LAST_MODIFIED to CALLS table.

+ Bump database version to 1109
+ Update LAST_MODIFIED when CALLS table is inserted/updated/
marked deleted.

Bug:22013880
Bug:25197644

Change-Id: I19512dd93179def0dafb386894acf09b0a49fb1b
/packages/providers/ContactsProvider/tests/src/com/android/providers/contacts/VoicemailProviderTest.java
5c466282ff1ebecb37c93dcb6d6ccfc845330e65 20-Jun-2015 Nancy Chen <nancychen@google.com> Fix read voicemails being marked as "new".

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
/packages/providers/ContactsProvider/tests/src/com/android/providers/contacts/VoicemailProviderTest.java
47fc56dd40613fae565d0c4d630f5f0b5fc310ff 20-May-2015 Yorke Lee <yorkelee@google.com> Fix broken CP2 unit tests and voicemail cleanup

* Delete voicemails when VoicemailCleanupService runs by
checking whether delete is called internally.
* Delete unnecessary MockPackageManager class, and consolidate
all logic into ContactsMockPackageManager
* Separate permissions tests and delete logic tests in
VoicemailProviderTest
* Correct the number of exposed Call columns in CallLogProviderTest

Bug: 20669398
Change-Id: I695b82b639b93f3ce85bf6e20000279f19e4a14a
/packages/providers/ContactsProvider/tests/src/com/android/providers/contacts/VoicemailProviderTest.java
dca8f302db8e661f13f3585bc67c53a5adf36617 02-Apr-2015 Nancy Chen <nancychen@google.com> Add phone_account_* fields to voicemail content table allowed columns.

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
/packages/providers/ContactsProvider/tests/src/com/android/providers/contacts/VoicemailProviderTest.java
0f74e8600ad744f2e4ba9c6a4cdadf5da5a20e83 03-Feb-2015 Nancy Chen <nancychen@google.com> Upgrade voicemail_status and calls tables for visual voicemail.

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
/packages/providers/ContactsProvider/tests/src/com/android/providers/contacts/VoicemailProviderTest.java
2ad39edbd856f3ea1177788aff7e653e593781eb 19-Jul-2014 Yorke Lee <yorkelee@google.com> Rename voicemail permissions

Rename READ_ALL_VOICEMAIL to READ_VOICEMAIL, and MANAGE_VOICEMAIL
to WRITE_VOICEMAIL
Bug: 16400686

Change-Id: I45d841b886c2bbe230c2f13fddbce41a729b6c61
/packages/providers/ContactsProvider/tests/src/com/android/providers/contacts/VoicemailProviderTest.java
d372af60001602a8c6cccf6258b514360c69b513 14-Jul-2014 Yorke Lee <yorkelee@google.com> Add TRANSCRIPTION column to Calls table

Bug: 10928782
Change-Id: I8e0e53e3c746baa64dd868a0e1c57444e2050578
/packages/providers/ContactsProvider/tests/src/com/android/providers/contacts/VoicemailProviderTest.java
ab2ec1d4316770e2ce8dc47dd1ae71430cd70e36 25-Jun-2014 Yorke Lee <yorkelee@google.com> Add manage voicemail permission (2/4)

Update CallLogProvider and VoicemailProvider to provide read/write access to
voicemails based on their respective permissions.

Also update tests to reflect the new world.

Bug: 6948882

Change-Id: I26e960eae24dc1b8bd4a372420d4c42f242c88d3
/packages/providers/ContactsProvider/tests/src/com/android/providers/contacts/VoicemailProviderTest.java
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/VoicemailProviderTest.java
9d84fd3de4464d8d19a8aa419682f75d0089c752 10-Jan-2012 Makoto Onuki <omakoto@google.com> Add missing size annotations to provider tests

Change-Id: I6673bbd55fbb4cd5aec419d8684765366d5e3161
/packages/providers/ContactsProvider/tests/src/com/android/providers/contacts/VoicemailProviderTest.java
aeaba441ddb05dede8bd86291ca78f42d670d54c 09-Aug-2011 Flavio Lerda <flerda@google.com> Automatically add a geocoded location to entries in the call log.

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
/packages/providers/ContactsProvider/tests/src/com/android/providers/contacts/VoicemailProviderTest.java
eeffa7edb048e785ebc665c830dc84d87f174b07 04-Aug-2011 Debashish Chatterjee <debashishc@google.com> Allow read-only sharing of Uri in voicemail content provider.

Since we perform our own permission check, uri permission check
done by the content resolver is not sufficient. Our implementation of
the content provider should also explicitly check for uri level permission.

This is needed to allow sharing of voicemail uri from the contacts app.

In a follow up change we will allow sharing of URIs only to those apps that has
ALL permission. Right now the provider definition does not allow sharing
of uri.

Bug: 4961053
Change-Id: I5af53ee76ea10fa5f45c8cdcb95c773cc7ad138e
/packages/providers/ContactsProvider/tests/src/com/android/providers/contacts/VoicemailProviderTest.java
0b442c4154c77f39aeb84216f433e5bd11cbf79e 04-Aug-2011 Debashish Chatterjee <debashishc@google.com> Fixed broken VoicemailContentProviderTest.

The tests were broken in two areas following recent changes
- permission READ_WRITE_OWN_VOICEMAIL was renamed to ADD_VOICEMAIL in
the production code, but was not renamed in test.
- Two new synthetic fields DISPLAY_NAME and SIZE were added in the
production code but the expected num fields were not updated in the
tests.

Change-Id: I96c1997af8dadb5a95d7224b0364cf48e6244977
/packages/providers/ContactsProvider/tests/src/com/android/providers/contacts/VoicemailProviderTest.java
c6eb4fe44502116f834fadcc54214b3fa93ff564 28-Jul-2011 Debashish Chatterjee <debashishc@google.com> Delete voicemail data when source package is uninstalled.

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
/packages/providers/ContactsProvider/tests/src/com/android/providers/contacts/VoicemailProviderTest.java
d558ccc921460ac382850a8e6e2e668f3a2b9b26 29-Jul-2011 Debashish Chatterjee <debashishc@google.com> No more use audio mime type for voicemail uris.

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
/packages/providers/ContactsProvider/tests/src/com/android/providers/contacts/VoicemailProviderTest.java
51d1da962292ecef21abdf7e41abfdb7f1d72fcd 27-Jul-2011 Debashish Chatterjee <debashishc@google.com> Merge "Improvements in voicemail broadcast notifications."
94cc8c65bc46f60b912091d3037376e15b74da0f 26-Jul-2011 Flavio Lerda <flerda@google.com> Do not expose the NEW column in the Voicemail provider.

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
/packages/providers/ContactsProvider/tests/src/com/android/providers/contacts/VoicemailProviderTest.java
9a5dfea6acfb15cff4654e10ea96ecd50a4d15b5 26-Jul-2011 Debashish Chatterjee <debashishc@google.com> Fixed VoicemailProviderTest.

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
/packages/providers/ContactsProvider/tests/src/com/android/providers/contacts/VoicemailProviderTest.java
929a04e2830e30718930d96335dfb0a729b6ab91 23-Jul-2011 Debashish Chatterjee <debashishc@google.com> Improvements in voicemail broadcast notifications.

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
/packages/providers/ContactsProvider/tests/src/com/android/providers/contacts/VoicemailProviderTest.java
b2197b235e3d96e7f70c24d548b7dac52dab88d8 21-Jul-2011 Flavio Lerda <flerda@google.com> Implement IS_READ column in content providers.

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
/packages/providers/ContactsProvider/tests/src/com/android/providers/contacts/VoicemailProviderTest.java
9cf06e7bcb0be759f1c930412fd2e41eba4f5f03 06-Jul-2011 Debashish Chatterjee <debashishc@google.com> VoicemailStatus content provider implementation.

- 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
/packages/providers/ContactsProvider/tests/src/com/android/providers/contacts/VoicemailProviderTest.java
4b571ba0de4fac4ff9d2a4277032b8c6548fdbfa 05-Jul-2011 Debashish Chatterjee <debashishc@google.com> Refactored VoicemailContentProvider to simplify using multiple tables.

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
/packages/providers/ContactsProvider/tests/src/com/android/providers/contacts/VoicemailProviderTest.java
e36e13b9e92759bb861a10ff22195853359c267d 04-Jul-2011 Debashish Chatterjee <debashishc@google.com> Modified voicemail provider to accept source_package as a param.

Voicemail provider now no more supports /source/ path. Also stopped
using deprecated fields of VoicemailContract.

Change-Id: Ieab08781bca6ec571f29c56ca55d84a8fd18547b
/packages/providers/ContactsProvider/tests/src/com/android/providers/contacts/VoicemailProviderTest.java
06f995b614e0ebe59ff75f170e20ca96c9b17f0c 01-Jul-2011 Debashish Chatterjee <debashishc@google.com> Send broadcast intents to specific component instead of package.

This avoids sending duplicate notification to the same package if it has
more than components registered for the same broadcast.

Change-Id: I93744aebc9a4800c5ce1fd60fb1468382f55934e
/packages/providers/ContactsProvider/tests/src/com/android/providers/contacts/VoicemailProviderTest.java
975d52af754e6f05089fcd9f7066df05c290c3b7 01-Jul-2011 Debashish Chatterjee <debashishc@google.com> Fixed VoicemailProviderTest.

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
/packages/providers/ContactsProvider/tests/src/com/android/providers/contacts/VoicemailProviderTest.java
00e7c94b70f4b477653534dbe559d1759d796157 16-Jun-2011 Debashish Chatterjee <debashishc@google.com> Added checks in voicemail provider to not expose call_log fields.

- 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
/packages/providers/ContactsProvider/tests/src/com/android/providers/contacts/VoicemailProviderTest.java
1975b56a3368b4b7684429ffa79e7b9dbc35b475 16-Jun-2011 Debashish Chatterjee <debashishc@google.com> Unit tests for voicemail provider.

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
/packages/providers/ContactsProvider/tests/src/com/android/providers/contacts/VoicemailProviderTest.java