summaryrefslogtreecommitdiffstats
path: root/src/com/android/providers/contacts/VoicemailContentTable.java
diff options
context:
space:
mode:
authorFlavio Lerda <flerda@google.com>2011-09-05 15:22:07 +0100
committerFlavio Lerda <flerda@google.com>2011-09-05 15:22:07 +0100
commitf402aaf776fee29d8044d97979b16695f24086dd (patch)
tree43dabb11585477cc8e358a24a3d89a67ddc98b6f /src/com/android/providers/contacts/VoicemailContentTable.java
parenta5542f6ec9ef1ee2f54ce85f26d826bd88e4a5b1 (diff)
downloadpackages_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.java4
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());