Fix Tests with Proguard enabled

Bug: 2487277
Change-Id: I213fcf3037c4f2f5789535c7c3193fc05b9fd919
diff --git a/Android.mk b/Android.mk
index 1af02c2..d574b3f 100644
--- a/Android.mk
+++ b/Android.mk
@@ -10,6 +10,8 @@
 LOCAL_PACKAGE_NAME := Contacts
 LOCAL_CERTIFICATE := shared
 
+LOCAL_PROGUARD_FLAGS := -include $(LOCAL_PATH)/proguard.flags
+
 include $(BUILD_PACKAGE)
 
 # Use the folloing include to make our test apk.
diff --git a/proguard.flags b/proguard.flags
new file mode 100644
index 0000000..6cc704c
--- /dev/null
+++ b/proguard.flags
@@ -0,0 +1,14 @@
+-keep class com.android.contacts.model.Sources {
+  public <init>(...);
+}
+
+# TODO: Instead of keeping the following two functions we could as well just remove them completely
+# as they are only used in test code
+
+-keep class com.android.contacts.model.EntityDelta {
+  public com.android.contacts.model.EntityDelta$ValuesDelta getSuperPrimaryEntry(java.lang.String,boolean);
+}
+
+-keep class com.android.contacts.model.EntityDelta$ValuesDelta {
+  public android.content.ContentValues getAfter();
+}