diff --git a/core/api/current.txt b/core/api/current.txt index da2b4e9490874..39ac0d2ebad2c 100644 --- a/core/api/current.txt +++ b/core/api/current.txt @@ -35148,6 +35148,7 @@ package android.provider { field public static final String CONTENT_TYPE = "vnd.android.cursor.dir/phone_v2"; field public static final android.net.Uri CONTENT_URI; field public static final android.net.Uri ENTERPRISE_CONTENT_FILTER_URI; + field @NonNull public static final android.net.Uri ENTERPRISE_CONTENT_URI; field public static final String EXTRA_ADDRESS_BOOK_INDEX = "android.provider.extra.ADDRESS_BOOK_INDEX"; field public static final String EXTRA_ADDRESS_BOOK_INDEX_COUNTS = "android.provider.extra.ADDRESS_BOOK_INDEX_COUNTS"; field public static final String EXTRA_ADDRESS_BOOK_INDEX_TITLES = "android.provider.extra.ADDRESS_BOOK_INDEX_TITLES"; @@ -35328,6 +35329,7 @@ package android.provider { field public static final String CONTENT_VCARD_TYPE = "text/x-vcard"; field public static final android.net.Uri CONTENT_VCARD_URI; field public static final android.net.Uri ENTERPRISE_CONTENT_FILTER_URI; + field @NonNull public static final android.net.Uri ENTERPRISE_CONTENT_URI; field public static final String EXTRA_ADDRESS_BOOK_INDEX = "android.provider.extra.ADDRESS_BOOK_INDEX"; field public static final String EXTRA_ADDRESS_BOOK_INDEX_COUNTS = "android.provider.extra.ADDRESS_BOOK_INDEX_COUNTS"; field public static final String EXTRA_ADDRESS_BOOK_INDEX_TITLES = "android.provider.extra.ADDRESS_BOOK_INDEX_TITLES"; diff --git a/core/api/system-current.txt b/core/api/system-current.txt index 92722901e485d..fb742607d9d25 100644 --- a/core/api/system-current.txt +++ b/core/api/system-current.txt @@ -10703,10 +10703,6 @@ package android.provider { field public static final int ERROR_UNKNOWN = 0; // 0x0 } - public static final class ContactsContract.CommonDataKinds.Phone implements android.provider.ContactsContract.CommonDataKinds.CommonColumns android.provider.ContactsContract.DataColumnsWithJoins { - field @NonNull @RequiresPermission(android.Manifest.permission.INTERACT_ACROSS_USERS) public static final android.net.Uri ENTERPRISE_CONTENT_URI; - } - @Deprecated public static final class ContactsContract.MetadataSync implements android.provider.BaseColumns android.provider.ContactsContract.MetadataSyncColumns { field @Deprecated public static final String CONTENT_ITEM_TYPE = "vnd.android.cursor.item/contact_metadata"; field @Deprecated public static final String CONTENT_TYPE = "vnd.android.cursor.dir/contact_metadata"; diff --git a/core/api/test-current.txt b/core/api/test-current.txt index 5e02e72f20885..c36aa61924601 100644 --- a/core/api/test-current.txt +++ b/core/api/test-current.txt @@ -2203,10 +2203,6 @@ package android.provider { field public static final String HIDDEN_COLUMN_PREFIX = "x_"; } - public static final class ContactsContract.CommonDataKinds.Phone implements android.provider.ContactsContract.CommonDataKinds.CommonColumns android.provider.ContactsContract.DataColumnsWithJoins { - field @NonNull @RequiresPermission(android.Manifest.permission.INTERACT_ACROSS_USERS) public static final android.net.Uri ENTERPRISE_CONTENT_URI; - } - public static final class ContactsContract.PinnedPositions { field public static final String UNDEMOTE_METHOD = "undemote"; } diff --git a/core/java/android/provider/ContactsContract.java b/core/java/android/provider/ContactsContract.java index d50ba8de8fa6b..363d035ea774b 100644 --- a/core/java/android/provider/ContactsContract.java +++ b/core/java/android/provider/ContactsContract.java @@ -435,25 +435,27 @@ public final class ContactsContract { Uri.withAppendedPath(AUTHORITY_URI, "directories"); /** - * URI used for getting all directories from primary and managed profile. - * It supports the same semantics as {@link #CONTENT_URI} and returns the same columns. - * If the device has no managed profile that is linked to the current profile, it behaves - * in the exact same way as {@link #CONTENT_URI}. - * If there is a managed profile linked to the current profile, it will merge - * managed profile and current profile's results and return. - * - * Note: this query returns primary profile results before managed profile results, - * and this order is not affected by sorting parameter. + * URI used for getting all directories from both the calling user and the managed profile + * that is linked to it. + *

+ * It supports the same semantics as {@link #CONTENT_URI} and returns the same columns.
+ * If the device has no managed profile that is linked to the calling user, it behaves + * in the exact same way as {@link #CONTENT_URI}.
+ * If there is a managed profile linked to the calling user, it will return merged results + * from both. + *

+ * Note: this query returns the calling user results before the managed profile results, + * and this order is not affected by the sorting parameter. * */ public static final Uri ENTERPRISE_CONTENT_URI = Uri.withAppendedPath(AUTHORITY_URI, "directories_enterprise"); /** - * Access file provided by remote directory. It allows both personal and work remote - * directory, but not local and invisible diretory. - * - * It's supported only by a few specific places for referring to contact pictures in the + * Access file provided by remote directory. It allows both calling user and managed profile + * remote directory, but not local and invisible directory. + *

+ * It is supported only by a few specific places for referring to contact pictures in the * remote directory. Contact picture URIs, e.g. * {@link PhoneLookup#ENTERPRISE_CONTENT_FILTER_URI}, may contain this kind of URI. * @@ -490,13 +492,13 @@ public final class ContactsContract { public static final long LOCAL_INVISIBLE = 1; /** - * _ID of the work profile default directory, which represents locally stored contacts. + * _ID of the managed profile default directory, which represents locally stored contacts. */ public static final long ENTERPRISE_DEFAULT = Directory.ENTERPRISE_DIRECTORY_ID_BASE + DEFAULT; /** - * _ID of the work profile directory that represents locally stored invisible contacts. + * _ID of the managed profile directory that represents locally stored invisible contacts. */ public static final long ENTERPRISE_LOCAL_INVISIBLE = Directory.ENTERPRISE_DIRECTORY_ID_BASE + LOCAL_INVISIBLE; @@ -557,8 +559,8 @@ public final class ContactsContract { public static final String ACCOUNT_NAME = "accountName"; /** - * Mimimal ID for corp directory returned from - * {@link Directory#CORP_CONTENT_URI}. + * Mimimal ID for managed profile directory returned from + * {@link Directory#ENTERPRISE_CONTENT_URI}. * * @hide */ @@ -1537,12 +1539,42 @@ public final class ContactsContract { public static final Uri CONTENT_URI = Uri.withAppendedPath(AUTHORITY_URI, "contacts"); /** - * Special contacts URI to refer to contacts on the corp profile from the personal - * profile. - * + * URI used for getting all contacts from both the calling user and the managed profile + * that is linked to it. + *

+ * It supports the same semantics as {@link #CONTENT_URI} and returns the same columns.
+ * If the calling user has no managed profile, it behaves in the exact same way as + * {@link #CONTENT_URI}.
+ * If there is a managed profile linked to the calling user, it will return merged results + * from both. + *

+ * Note: this query returns the calling user results before the managed profile results, + * and this order is not affected by the sorting parameter. + *

+ * If a result is from the managed profile, the following changes are made to the data: + *