Share via


ContactsContract.PhoneLookup.EnterpriseContentFilterUri Property

Definition

URI used for looking up contacts by phone number on the contact databases of both the calling user and the managed profile that is linked to it.

[Android.Runtime.Register("ENTERPRISE_CONTENT_FILTER_URI")]
public static Android.Net.Uri? EnterpriseContentFilterUri { get; }
[<Android.Runtime.Register("ENTERPRISE_CONTENT_FILTER_URI")>]
static member EnterpriseContentFilterUri : Android.Net.Uri

Property Value

Uri
Attributes

Remarks

URI used for looking up contacts by phone number on the contact databases of both the calling user and the managed profile that is linked to it.

It supports the same semantics as #CONTENT_FILTER_URI and returns the same columns.<br> If the device has no managed profile that is linked to the calling user, it behaves in the exact same way as #CONTENT_FILTER_URI.<br> If there is a managed profile linked to the calling user, it first queries the calling user's contact database, and only if no matching contacts are found there it then queries the managed profile database. <p class="caution"> <b>Caution: </b>If you publish your app to the Google Play Store, this field doesn't sort results based on contacts frequency. For more information, see the Contacts Provider page.

If a result is from the managed profile, the following changes are made to the data: <ul> <li>#PHOTO_THUMBNAIL_URI and #PHOTO_URI will be rewritten to special URIs. Use ContentResolver#openAssetFileDescriptor or its siblings to load pictures from them. <li>#PHOTO_ID and #PHOTO_FILE_ID will be set to null. Don't use them. <li>#CONTACT_ID and #LOOKUP_KEY will be replaced with artificial values. These values will be consistent across multiple queries, but do not use them in places that do not explicitly say they accept them. If they are used in the selection param in android.content.ContentProvider#query, the result is undefined. <li>In order to tell whether a contact is from the managed profile, use ContactsContract.Contacts#isEnterpriseContactId(long).

A contact lookup URL built by ContactsContract.Contacts#getLookupUri(long, String) with a #CONTACT_ID and a #LOOKUP_KEY returned by this API can be passed to ContactsContract.QuickContact#showQuickContact even if a contact is from the managed profile.

Uri lookupUri = Uri.withAppendedPath(PhoneLookup.ENTERPRISE_CONTENT_FILTER_URI,
                    Uri.encode(phoneNumber));

Java documentation for android.provider.ContactsContract.PhoneLookup.ENTERPRISE_CONTENT_FILTER_URI.

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to