Do contact picker queries require the read_contact

2019-08-01 15:50发布

问题:

We have been experimenting with the Android contact picker to allow users to select a contact without the app requiring the READ_CONTACTS permission. The following intents appear to work on 4.0 (ICS) devices as well as a 2.3.3 emulator:

Intent contactPickerIntent = new Intent(Intent.ACION_GET_CONTENT);
contactPickerIntent.setType(Phone.CONTENT_ITEM_TYPE); // returns content://com.android.contacts/data/...

Intent contactPickerIntent = new Intent(Intent.ACTION_PICK, Contacts.CONTENT_URI); // returns content://com.android.contacts/lookup/...

On a 2.2 emulator and certain pre-ICS models (e.g., HTC Thunderbolt, Motorola Droid), however, attempting to query the returned UI results in a permission denial exception:

Caused by: java.lang.SecurityException: Permission Denial: reading com.android.providers.contacts.ContactsProvider2 uri content://com.android.contacts/contacts/lookup/0r1-52345052324E483C32/1 from pid=273, uid=10036 requires android.permission.READ_CONTACTS

This looks like a OS or device fragmentation issue; we're seeking clarification on this topic so that we can move forward with this or an alternate approach.

Thoughts?