Don't ignore "update to empty" when checking whether the state is dirty
Bug: 4026427
Change-Id: Ia13ad1d7e0901e3a89aa53c21e70ce0becd51d94
diff --git a/src/com/android/contacts/model/EntityModifier.java b/src/com/android/contacts/model/EntityModifier.java
index ab19a35..1e014ef 100644
--- a/src/com/android/contacts/model/EntityModifier.java
+++ b/src/com/android/contacts/model/EntityModifier.java
@@ -430,8 +430,10 @@
if (entries == null) continue;
for (ValuesDelta entry : entries) {
- if ((entry.isInsert() || entry.isUpdate() || entry.isDelete())
- && !isEmpty(entry, kind)) {
+ // An empty Insert must be ignored, because it won't save anything (an example
+ // is an empty name that stays empty)
+ final boolean isRealInsert = entry.isInsert() && !isEmpty(entry, kind);
+ if (isRealInsert || entry.isUpdate() || entry.isDelete()) {
return true;
}
}