OSDN Git Service

Don't pass the query parameter in if the calling package is null.
authorJeff Hamilton <jham@android.com>
Wed, 30 Sep 2009 08:57:10 +0000 (01:57 -0700)
committerJeff Hamilton <jham@android.com>
Wed, 30 Sep 2009 09:01:11 +0000 (02:01 -0700)
The provider would read the string "null" and always refuse restricted access.

Change-Id: I1a592c2284ada8ab3c41bc71e510bd4ec7fd05d8

src/com/android/contacts/ContactsListActivity.java

index f164289..529f145 100644 (file)
@@ -1562,10 +1562,14 @@ public class ContactsListActivity extends ListActivity implements
         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) {