From 44cfc56d1701629070384364416c1311b780535d Mon Sep 17 00:00:00 2001 From: Chiao Cheng Date: Thu, 13 Sep 2012 13:06:23 -0700 Subject: Allow read-only contacts to be editable. - Automatically create new raw contact when editing a read-only contact. - Refactored mState to be always initialized. - Allow RawContactDeltaList to be instantiated with empty constructor. Bug: 6406182 Change-Id: I7a58625485dae6957b4f9bcc446122f54551afa1 --- tests/src/com/android/contacts/RawContactModifierTests.java | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'tests/src/com/android/contacts/RawContactModifierTests.java') diff --git a/tests/src/com/android/contacts/RawContactModifierTests.java b/tests/src/com/android/contacts/RawContactModifierTests.java index 91358ca37..ce69b55bc 100644 --- a/tests/src/com/android/contacts/RawContactModifierTests.java +++ b/tests/src/com/android/contacts/RawContactModifierTests.java @@ -521,7 +521,9 @@ public class RawContactModifierTests extends AndroidTestCase { // Try creating a contact without any child entries final RawContactDelta state = getRawContact(null); - final RawContactDeltaList set = RawContactDeltaList.fromSingle(state); + final RawContactDeltaList set = new RawContactDeltaList(); + set.add(state); + // Build diff, expecting single insert final ArrayList diff = Lists.newArrayList(); @@ -549,7 +551,8 @@ public class RawContactModifierTests extends AndroidTestCase { // Try creating a contact with single empty entry final RawContactDelta state = getRawContact(null); RawContactModifier.insertChild(state, kindPhone, typeHome); - final RawContactDeltaList set = RawContactDeltaList.fromSingle(state); + final RawContactDeltaList set = new RawContactDeltaList(); + set.add(state); // Build diff, expecting two insert operations final ArrayList diff = Lists.newArrayList(); @@ -593,7 +596,8 @@ public class RawContactModifierTests extends AndroidTestCase { second.put(Phone.NUMBER, TEST_PHONE); final RawContactDelta state = getRawContact(TEST_ID, first, second); - final RawContactDeltaList set = RawContactDeltaList.fromSingle(state); + final RawContactDeltaList set = new RawContactDeltaList(); + set.add(state); // Build diff, expecting no changes final ArrayList diff = Lists.newArrayList(); @@ -658,7 +662,8 @@ public class RawContactModifierTests extends AndroidTestCase { first.put(Phone.NUMBER, TEST_PHONE); final RawContactDelta state = getRawContact(TEST_ID, first); - final RawContactDeltaList set = RawContactDeltaList.fromSingle(state); + final RawContactDeltaList set = new RawContactDeltaList(); + set.add(state); // Build diff, expecting no changes final ArrayList diff = Lists.newArrayList(); -- cgit v1.2.3