summaryrefslogtreecommitdiffstats
path: root/src/com/android/contacts/common/model/ValuesDelta.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/com/android/contacts/common/model/ValuesDelta.java')
-rw-r--r--src/com/android/contacts/common/model/ValuesDelta.java16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/com/android/contacts/common/model/ValuesDelta.java b/src/com/android/contacts/common/model/ValuesDelta.java
index e30cdd62..2db7e1c8 100644
--- a/src/com/android/contacts/common/model/ValuesDelta.java
+++ b/src/com/android/contacts/common/model/ValuesDelta.java
@@ -23,6 +23,7 @@ import android.os.Parcel;
import android.os.Parcelable;
import android.provider.BaseColumns;
import android.provider.ContactsContract;
+import android.provider.ContactsContract.Data;
import com.android.contacts.common.testing.NeededForTesting;
import com.google.common.collect.Sets;
@@ -61,6 +62,17 @@ public class ValuesDelta implements Parcelable {
final ValuesDelta entry = new ValuesDelta();
entry.mBefore = before;
entry.mAfter = new ContentValues();
+
+ // init data1 to mAfter map. when no operation edittext of
+ // sim phone in the UI, the mAfter init have no data1 value,
+ // it will cause the builddiff data not right.
+ if (before.containsKey(Data.DATA1)) {
+ String contactInfo = before.getAsString(Data.DATA1);
+ if (null != contactInfo && !"".equals(contactInfo)) {
+ entry.mAfter.put(Data.DATA1, contactInfo);
+ }
+ }
+
return entry;
}
@@ -83,6 +95,10 @@ public class ValuesDelta implements Parcelable {
return mAfter;
}
+ public ContentValues getBefore() {
+ return mBefore;
+ }
+
public boolean containsKey(String key) {
return ((mAfter != null && mAfter.containsKey(key)) ||
(mBefore != null && mBefore.containsKey(key)));