diff options
8 files changed, 21 insertions, 16 deletions
diff --git a/proguard.flags b/proguard.flags index f4ec4b2ea..79378e644 100644 --- a/proguard.flags +++ b/proguard.flags @@ -9,24 +9,10 @@ public void *(android.view.MenuItem); } -# 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(); -} - -# Any methods whose name is '*ForTest' are preserved. --keep class ** { - *** *ForTest(...); -} - # Any class or method annotated with NeededForTesting. -keep @com.android.contacts.test.NeededForTesting class * -keepclassmembers class * { @com.android.contacts.test.NeededForTesting *; } + +-verbose diff --git a/src/com/android/contacts/PhoneCallDetailsHelper.java b/src/com/android/contacts/PhoneCallDetailsHelper.java index 60dfb7bd1..fd950fed1 100644 --- a/src/com/android/contacts/PhoneCallDetailsHelper.java +++ b/src/com/android/contacts/PhoneCallDetailsHelper.java @@ -18,6 +18,7 @@ package com.android.contacts; import com.android.contacts.calllog.CallTypeHelper; import com.android.contacts.calllog.PhoneNumberHelper; +import com.android.contacts.test.NeededForTesting; import android.content.res.Resources; import android.graphics.Typeface; @@ -141,6 +142,7 @@ public class PhoneCallDetailsHelper { nameView.setText(nameText); } + @NeededForTesting public void setCurrentTimeForTest(long currentTimeMillis) { mCurrentTimeMillisForTest = currentTimeMillis; } diff --git a/src/com/android/contacts/calllog/CallLogListItemViews.java b/src/com/android/contacts/calllog/CallLogListItemViews.java index 741d2184d..503de4384 100644 --- a/src/com/android/contacts/calllog/CallLogListItemViews.java +++ b/src/com/android/contacts/calllog/CallLogListItemViews.java @@ -18,6 +18,7 @@ package com.android.contacts.calllog; import com.android.contacts.PhoneCallDetailsViews; import com.android.contacts.R; +import com.android.contacts.test.NeededForTesting; import android.content.Context; import android.view.View; @@ -68,6 +69,7 @@ public final class CallLogListItemViews { view.findViewById(R.id.call_log_divider)); } + @NeededForTesting public static CallLogListItemViews createForTest(Context context) { return new CallLogListItemViews( new QuickContactBadge(context), diff --git a/src/com/android/contacts/editor/ContactEditorUtils.java b/src/com/android/contacts/editor/ContactEditorUtils.java index 05a041dec..46006a0cc 100644 --- a/src/com/android/contacts/editor/ContactEditorUtils.java +++ b/src/com/android/contacts/editor/ContactEditorUtils.java @@ -19,6 +19,7 @@ package com.android.contacts.editor; import com.android.contacts.model.AccountType; import com.android.contacts.model.AccountTypeManager; import com.android.contacts.model.AccountWithDataSet; +import com.android.contacts.test.NeededForTesting; import com.google.common.annotations.VisibleForTesting; import com.google.common.collect.ImmutableList; import com.google.common.collect.Sets; @@ -74,11 +75,13 @@ public class ContactEditorUtils { return sInstance; } + @NeededForTesting void cleanupForTest() { mPrefs.edit().remove(KEY_DEFAULT_ACCOUNT).remove(KEY_KNOWN_ACCOUNTS) .remove(KEY_ANYTHING_SAVED).apply(); } + @NeededForTesting void removeDefaultAccountForTest() { mPrefs.edit().remove(KEY_DEFAULT_ACCOUNT).apply(); } diff --git a/src/com/android/contacts/model/BaseAccountType.java b/src/com/android/contacts/model/BaseAccountType.java index ce74148c8..1e830e2ad 100644 --- a/src/com/android/contacts/model/BaseAccountType.java +++ b/src/com/android/contacts/model/BaseAccountType.java @@ -17,6 +17,7 @@ package com.android.contacts.model; import com.android.contacts.R; +import com.android.contacts.test.NeededForTesting; import com.android.contacts.util.DateUtils; import com.google.android.collect.Lists; import com.google.android.collect.Maps; @@ -490,6 +491,7 @@ public abstract class BaseAccountType extends AccountType { + " mColumnName" + mColumnName; } + @NeededForTesting public String getColumnNameForTest() { return mColumnName; } diff --git a/src/com/android/contacts/model/EntityDelta.java b/src/com/android/contacts/model/EntityDelta.java index 8244e9c51..2cbfa2622 100644 --- a/src/com/android/contacts/model/EntityDelta.java +++ b/src/com/android/contacts/model/EntityDelta.java @@ -16,6 +16,7 @@ package com.android.contacts.model; +import com.android.contacts.test.NeededForTesting; import com.google.android.collect.Lists; import com.google.android.collect.Maps; import com.google.android.collect.Sets; @@ -183,6 +184,7 @@ public class EntityDelta implements Parcelable { * doesn't exist (may be a primary, or just a random item * @return */ + @NeededForTesting public ValuesDelta getSuperPrimaryEntry(String mimeType, boolean forceSelection) { final ArrayList<ValuesDelta> mimeEntries = getMimeEntries(mimeType, false); if (mimeEntries == null) return null; @@ -564,6 +566,7 @@ public class EntityDelta implements Parcelable { return entry; } + @NeededForTesting public ContentValues getAfter() { return mAfter; } diff --git a/src/com/android/contacts/model/FallbackAccountType.java b/src/com/android/contacts/model/FallbackAccountType.java index d81f2f5c1..6ce7a4357 100644 --- a/src/com/android/contacts/model/FallbackAccountType.java +++ b/src/com/android/contacts/model/FallbackAccountType.java @@ -17,6 +17,7 @@ package com.android.contacts.model; import com.android.contacts.R; +import com.android.contacts.test.NeededForTesting; import android.content.Context; import android.util.Log; @@ -63,6 +64,7 @@ public class FallbackAccountType extends BaseAccountType { * In order to build {@link DataKind}s with the same resource package name, * {@code resPackageName} is injectable. */ + @NeededForTesting static AccountType createForTest(Context context, String resPackageName) { return new FallbackAccountType(context, resPackageName); } diff --git a/src/com/android/contacts/widget/CompositeListAdapter.java b/src/com/android/contacts/widget/CompositeListAdapter.java index 692e07319..610b97f76 100644 --- a/src/com/android/contacts/widget/CompositeListAdapter.java +++ b/src/com/android/contacts/widget/CompositeListAdapter.java @@ -15,6 +15,7 @@ */ package com.android.contacts.widget; +import com.android.contacts.test.NeededForTesting; import com.google.common.annotations.VisibleForTesting; import android.database.DataSetObserver; @@ -27,7 +28,11 @@ import android.widget.ListAdapter; * A general purpose adapter that is composed of multiple sub-adapters. It just * appends them in the order they are added. It listens to changes from all * sub-adapters and propagates them to its own listeners. + * + * This class not used for now -- but let's keep running the test in case we want to revive it... + * (So NeededForTesting) */ +@NeededForTesting public class CompositeListAdapter extends BaseAdapter { private static final int INITIAL_CAPACITY = 2; |