Skip to content
This repository has been archived by the owner on Nov 8, 2023. It is now read-only.

Commit

Permalink
Fix proguard flags
Browse files Browse the repository at this point in the history
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
Makoto Onuki committed Jan 27, 2012
1 parent 7e08647 commit 833072a
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
7 changes: 2 additions & 5 deletions proguard.flags
Expand Up @@ -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
Expand Up @@ -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;
Expand Down Expand Up @@ -5207,6 +5208,7 @@ public String getCurrentCountryIso() {
return mCountryMonitor.getCountryIso();
}

@NeededForTesting
/* package */ String querySearchIndexContentForTest(long contactId) {
return DatabaseUtils.stringForQuery(getReadableDatabase(),
"SELECT " + SearchIndexColumns.CONTENT +
Expand All @@ -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 +
Expand Down
1 change: 1 addition & 0 deletions src/com/android/providers/contacts/ContactsProvider2.java
Expand Up @@ -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();
}
Expand Down
Expand Up @@ -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;
Expand Down

0 comments on commit 833072a

Please sign in to comment.