summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorMakoto Onuki <omakoto@google.com>2015-02-18 16:02:36 -0800
committerMakoto Onuki <omakoto@google.com>2015-02-18 18:06:00 -0800
commit6522ca932caf4a4921115a2a3d13068c2357084c (patch)
treee73f362b2bc899d491f63aad12f9ed72221b2312 /tests
parent0f6927a6946350dcb3031baa9ce1c7575f48307e (diff)
downloadpackages_providers_ContactsProvider-6522ca932caf4a4921115a2a3d13068c2357084c.zip
packages_providers_ContactsProvider-6522ca932caf4a4921115a2a3d13068c2357084c.tar.gz
packages_providers_ContactsProvider-6522ca932caf4a4921115a2a3d13068c2357084c.tar.bz2
Don't use queryContentProviders to avoid "transaction too large" exception
Instead, use getInstalledPackages, which knows how to circumvent the binder transaction size limit. Bug 18261831 Change-Id: I2725af045c60a47bfce6eab966a5c745b6c17870
Diffstat (limited to 'tests')
-rw-r--r--tests/src/com/android/providers/contacts/ContactDirectoryManagerTest.java3
-rw-r--r--tests/src/com/android/providers/contacts/ContactsMockPackageManager.java13
2 files changed, 3 insertions, 13 deletions
diff --git a/tests/src/com/android/providers/contacts/ContactDirectoryManagerTest.java b/tests/src/com/android/providers/contacts/ContactDirectoryManagerTest.java
index be14f45..c5bc6f6 100644
--- a/tests/src/com/android/providers/contacts/ContactDirectoryManagerTest.java
+++ b/tests/src/com/android/providers/contacts/ContactDirectoryManagerTest.java
@@ -122,6 +122,9 @@ public class ContactDirectoryManagerTest extends BaseContactsProvider2Test {
public void testIsDirectoryProvider() {
ProviderInfo provider = new ProviderInfo();
+ // Null -- just return false.
+ assertFalse(ContactDirectoryManager.isDirectoryProvider(null));
+
// No metadata
assertFalse(ContactDirectoryManager.isDirectoryProvider(provider));
diff --git a/tests/src/com/android/providers/contacts/ContactsMockPackageManager.java b/tests/src/com/android/providers/contacts/ContactsMockPackageManager.java
index 694f0f3..a5aa7c7 100644
--- a/tests/src/com/android/providers/contacts/ContactsMockPackageManager.java
+++ b/tests/src/com/android/providers/contacts/ContactsMockPackageManager.java
@@ -96,17 +96,4 @@ public class ContactsMockPackageManager extends MockPackageManager {
public Resources getResourcesForApplication(String appPackageName) {
return new ContactsMockResources();
}
-
- @Override
- public List<ProviderInfo> queryContentProviders(String processName, int uid, int flags) {
- final List<ProviderInfo> ret = Lists.newArrayList();
- if (mPackages == null) return ret;
- for (PackageInfo packageInfo : mPackages) {
- if (packageInfo.providers == null) continue;
- for (ProviderInfo providerInfo : packageInfo.providers) {
- ret.add(providerInfo);
- }
- }
- return ret;
- }
}