diff options
author | Flavio Lerda <flerda@google.com> | 2011-09-05 15:22:07 +0100 |
---|---|---|
committer | Flavio Lerda <flerda@google.com> | 2011-09-05 15:22:07 +0100 |
commit | f402aaf776fee29d8044d97979b16695f24086dd (patch) | |
tree | 43dabb11585477cc8e358a24a3d89a67ddc98b6f /src/com/android/providers/contacts/VoicemailContentTable.java | |
parent | a5542f6ec9ef1ee2f54ce85f26d826bd88e4a5b1 (diff) | |
download | packages_providers_ContactsProvider-f402aaf776fee29d8044d97979b16695f24086dd.zip packages_providers_ContactsProvider-f402aaf776fee29d8044d97979b16695f24086dd.tar.gz packages_providers_ContactsProvider-f402aaf776fee29d8044d97979b16695f24086dd.tar.bz2 |
Fix voicemail tests.
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
Diffstat (limited to 'src/com/android/providers/contacts/VoicemailContentTable.java')
-rw-r--r-- | src/com/android/providers/contacts/VoicemailContentTable.java | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/com/android/providers/contacts/VoicemailContentTable.java b/src/com/android/providers/contacts/VoicemailContentTable.java index b4356cf..4d23531 100644 --- a/src/com/android/providers/contacts/VoicemailContentTable.java +++ b/src/com/android/providers/contacts/VoicemailContentTable.java @@ -98,11 +98,13 @@ public class VoicemailContentTable implements VoicemailTable.Delegate { @Override public Uri insert(UriData uriData, ContentValues values) { checkForSupportedColumns(mVoicemailProjectionMap, values); - mCallLogInsertionHelper.addComputedValues(values); ContentValues copiedValues = new ContentValues(values); checkInsertSupported(uriData); mDelegateHelper.checkAndAddSourcePackageIntoValues(uriData, copiedValues); + // Add the computed fields to the copied values. + mCallLogInsertionHelper.addComputedValues(copiedValues); + // "_data" column is used by base ContentProvider's openFileHelper() to determine filename // when Input/Output stream is requested to be opened. copiedValues.put(Voicemails._DATA, generateDataFile()); |