Introduce a NeededForTesting annotation.

This annotation can be used to mark those classes and methods that are
used by tests and that therefore should not be removed by ProGuard, even
if unused.

This is similar to VisibleForTesting annotation, but in this case, there
is increase of visibility, just happens that we do not currently use
those methods in the application code.

This fixes a number of failing tests in the continuous build. This
problem affects only userdebug builds, because eng builds do not run
ProGuard.

Bug: 5112827
Bug: 5131770
Change-Id: I13d06bc7bebb8f5d2d9ff515a5587b4f25bed5ac
diff --git a/proguard.flags b/proguard.flags
index 5a08b9f..f4ec4b2 100644
--- a/proguard.flags
+++ b/proguard.flags
@@ -24,3 +24,9 @@
 -keep class ** {
   *** *ForTest(...);
 }
+
+# Any class or method annotated with NeededForTesting.
+-keep @com.android.contacts.test.NeededForTesting class *
+-keepclassmembers class * {
+@com.android.contacts.test.NeededForTesting *;
+}