Skip to content
Browse files

Fix proguard flags

Removed the *ForTest exception.  It caused issues with guava.  Now that
we have NeededForTesting, we don't really need it.

(But didn't change method names from XxxForTest to Xxx, because I still
think using this prefix for test-only methods is a good idea, as it'll
make it easier to catch the use of methods in the main apk that are
not supposed to be used.)

Change-Id: Idccfd7175372b1a2253b19161ae572dae7e1e952
  • Loading branch information...
1 parent 7e08647 commit 833072a525ea45426082d3bac0cd6ae1a8c36f22 Makoto Onuki committed Jan 27, 2012
View
7 proguard.flags
@@ -7,13 +7,10 @@
int getCount();
}
-# Any methods whose name is '*ForTest' are preserved.
--keep class ** {
- *** *ForTest(...);
-}
-
# Any class or method annotated with NeededForTesting.
-keep @com.android.providers.contacts.util.NeededForTesting class *
-keepclassmembers class * {
@com.android.providers.contacts.util.NeededForTesting *;
}
+
+-verbose
View
3 src/com/android/providers/contacts/ContactsDatabaseHelper.java
@@ -17,6 +17,7 @@
package com.android.providers.contacts;
import com.android.common.content.SyncStateContentProviderHelper;
+import com.android.providers.contacts.util.NeededForTesting;
import com.google.android.collect.Sets;
import android.content.ContentResolver;
@@ -5207,6 +5208,7 @@ public String getCurrentCountryIso() {
return mCountryMonitor.getCountryIso();
}
+ @NeededForTesting
/* package */ String querySearchIndexContentForTest(long contactId) {
return DatabaseUtils.stringForQuery(getReadableDatabase(),
"SELECT " + SearchIndexColumns.CONTENT +
@@ -5215,6 +5217,7 @@ public String getCurrentCountryIso() {
new String[] { String.valueOf(contactId) });
}
+ @NeededForTesting
/* package */ String querySearchIndexTokensForTest(long contactId) {
return DatabaseUtils.stringForQuery(getReadableDatabase(),
"SELECT " + SearchIndexColumns.TOKENS +
View
1 src/com/android/providers/contacts/ContactsProvider2.java
@@ -8004,6 +8004,7 @@ private boolean snippetNeeded(String [] projection) {
/**
* @return the currently active {@link ContactsDatabaseHelper} for the current thread.
*/
+ @NeededForTesting
public ContactsDatabaseHelper getThreadActiveDatabaseHelperForTest() {
return mDbHelper.get();
}
View
3 tests/src/com/android/providers/contacts/ContactsMockResources.java
@@ -16,9 +16,8 @@
package com.android.providers.contacts;
-import com.google.common.collect.Maps;
+import com.google.android.collect.Maps;
-import android.content.res.Resources.NotFoundException;
import android.test.mock.MockResources;
import java.util.Map;

0 comments on commit 833072a

Please sign in to comment.
Something went wrong with that request. Please try again.