Don't pass the query parameter in if the calling package is null.
The provider would read the string "null" and always refuse restricted access.
Change-Id: I1a592c2284ada8ab3c41bc71e510bd4ec7fd05d8
diff --git a/src/com/android/contacts/ContactsListActivity.java b/src/com/android/contacts/ContactsListActivity.java
index f164289..529f145 100644
--- a/src/com/android/contacts/ContactsListActivity.java
+++ b/src/com/android/contacts/ContactsListActivity.java
@@ -1562,10 +1562,14 @@
mQueryHandler.setLoadingJoinSuggestions(false);
String[] projection = getProjectionForQuery();
- Uri uri = getUriToQuery().buildUpon()
- .appendQueryParameter(ContactsContract.REQUESTING_PACKAGE_PARAM_KEY,
- getCallingPackage())
- .build();
+ String callingPackage = getCallingPackage();
+ Uri uri = getUriToQuery();
+ if (!TextUtils.isEmpty(callingPackage)) {
+ uri = uri.buildUpon()
+ .appendQueryParameter(ContactsContract.REQUESTING_PACKAGE_PARAM_KEY,
+ callingPackage)
+ .build();
+ }
// Kick off the new query
switch (mMode) {