diff options
author | Chiao Cheng <chiaocheng@google.com> | 2012-09-13 13:06:23 -0700 |
---|---|---|
committer | Chiao Cheng <chiaocheng@google.com> | 2013-01-15 11:37:55 -0800 |
commit | 44cfc56d1701629070384364416c1311b780535d (patch) | |
tree | dc1241fe3278e431acb14b734f8d94526b614b4a /tests/src/com/android/contacts/RawContactModifierTests.java | |
parent | d683b541718154aa73ce3a304acd2cd3665a6737 (diff) | |
download | packages_apps_Contacts-44cfc56d1701629070384364416c1311b780535d.tar.gz packages_apps_Contacts-44cfc56d1701629070384364416c1311b780535d.tar.bz2 packages_apps_Contacts-44cfc56d1701629070384364416c1311b780535d.zip |
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
Diffstat (limited to 'tests/src/com/android/contacts/RawContactModifierTests.java')
-rw-r--r-- | tests/src/com/android/contacts/RawContactModifierTests.java | 13 |
1 files changed, 9 insertions, 4 deletions
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<ContentProviderOperation> 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<ContentProviderOperation> 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<ContentProviderOperation> 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<ContentProviderOperation> diff = Lists.newArrayList(); |