OSDN Git Service

Hook up logic for re-parenting of user edits, unit tests.
authorJeff Sharkey <jsharkey@android.com>
Tue, 22 Sep 2009 22:36:10 +0000 (15:36 -0700)
committerJeff Sharkey <jsharkey@android.com>
Wed, 23 Sep 2009 12:39:48 +0000 (05:39 -0700)
commit88d00c2450a0a16bf1dd35e9f3c9ba843a97ec62
tree1adadad4aad0e093ee98548068a741f54913a1fd
parent2e6148fe7d8a3e724d8a8f10780d7e5571780279
Hook up logic for re-parenting of user edits, unit tests.

When persisting edits, we assert that RawContacts.VERSION
has remained consistent.  When this check fails, it usually
means that a server change has changed the underlying data,
and instead of dropping user edits, we "re-parent" their
changes after re-reading the base data.

This change finishes up the re-parenting logic to run over
an entire EntitySet, and also has a nice pile of unit tests
to verify behavior.  Fixes http://b/2115136
src/com/android/contacts/model/EntityDelta.java
src/com/android/contacts/model/EntitySet.java
src/com/android/contacts/ui/EditContactActivity.java
tests/src/com/android/contacts/EntityDeltaTests.java
tests/src/com/android/contacts/EntityModifierTests.java
tests/src/com/android/contacts/EntitySetTests.java