OSDN Git Service

Ignore transient rows during re-parenting.
authorJeff Sharkey <jsharkey@android.com>
Wed, 7 Oct 2009 20:52:48 +0000 (13:52 -0700)
committerJeff Sharkey <jsharkey@android.com>
Thu, 8 Oct 2009 16:31:54 +0000 (09:31 -0700)
commit7173705177c421e0b2a3bc4579b2f8910a38a668
treedf2a78a73c348bf9aaba61f5feb060d18e5fa793
parent4c129c92cb8f7f4d2a1f5dcf69a7564d5c88fd9f
Ignore transient rows during re-parenting.

When editing, we create template rows such as StructuredName
and Photo, which may be trimmed before persisting if they
remain empty.  When a background change occurs and we need
to re-parent the users changes, we didn't handle this
special case, and treated these trimmed rows as inserts,
which triggered the reported missing MIME-type exception.

This change watches for "transient" rows that didn't exist
previously, but were inserted and then deleted during the
process of editing.  When encountered, they are ignored
during re-parenting, instead of turning into inserts.

Added a unit test to verify correct behavior, and also wrote
values-level verification for the existing unit tests.

Fixes http://b/2167925
src/com/android/contacts/model/EntityDelta.java
tests/src/com/android/contacts/EntityModifierTests.java
tests/src/com/android/contacts/EntitySetTests.java