Add Work Contacts Directory APIs
Add Work Contacts Directory APIs, so primary profile application can get work directory info. Bug: 25761127 Change-Id: I0bce6f8153d32e7da883911c5b0af182745e9d40
This commit is contained in:
@@ -25855,12 +25855,15 @@ package android.provider {
|
||||
}
|
||||
|
||||
public static final class ContactsContract.Directory implements android.provider.BaseColumns {
|
||||
method public static boolean isEnterpriseDirectoryId(long);
|
||||
method public static boolean isRemoteDirectory(long);
|
||||
method public static void notifyDirectoryChange(android.content.ContentResolver);
|
||||
field public static final java.lang.String ACCOUNT_NAME = "accountName";
|
||||
field public static final java.lang.String ACCOUNT_TYPE = "accountType";
|
||||
field public static final java.lang.String CONTENT_ITEM_TYPE = "vnd.android.cursor.item/contact_directory";
|
||||
field public static final java.lang.String CONTENT_TYPE = "vnd.android.cursor.dir/contact_directories";
|
||||
field public static final android.net.Uri CONTENT_URI;
|
||||
field public static final android.net.Uri CORP_CONTENT_URI;
|
||||
field public static final long DEFAULT = 0L; // 0x0L
|
||||
field public static final java.lang.String DIRECTORY_AUTHORITY = "authority";
|
||||
field public static final java.lang.String DISPLAY_NAME = "displayName";
|
||||
|
||||
@@ -27831,12 +27831,15 @@ package android.provider {
|
||||
}
|
||||
|
||||
public static final class ContactsContract.Directory implements android.provider.BaseColumns {
|
||||
method public static boolean isEnterpriseDirectoryId(long);
|
||||
method public static boolean isRemoteDirectory(long);
|
||||
method public static void notifyDirectoryChange(android.content.ContentResolver);
|
||||
field public static final java.lang.String ACCOUNT_NAME = "accountName";
|
||||
field public static final java.lang.String ACCOUNT_TYPE = "accountType";
|
||||
field public static final java.lang.String CONTENT_ITEM_TYPE = "vnd.android.cursor.item/contact_directory";
|
||||
field public static final java.lang.String CONTENT_TYPE = "vnd.android.cursor.dir/contact_directories";
|
||||
field public static final android.net.Uri CONTENT_URI;
|
||||
field public static final android.net.Uri CORP_CONTENT_URI;
|
||||
field public static final long DEFAULT = 0L; // 0x0L
|
||||
field public static final java.lang.String DIRECTORY_AUTHORITY = "authority";
|
||||
field public static final java.lang.String DISPLAY_NAME = "displayName";
|
||||
|
||||
@@ -393,6 +393,14 @@ public final class ContactsContract {
|
||||
public static final Uri CONTENT_URI =
|
||||
Uri.withAppendedPath(AUTHORITY_URI, "directories");
|
||||
|
||||
/**
|
||||
* The content:// style URI for enterprise Directory table. Requests to this URI can be
|
||||
* performed on the UI thread because they are always unblocking.
|
||||
*
|
||||
*/
|
||||
public static final Uri CORP_CONTENT_URI = Uri.withAppendedPath(AUTHORITY_URI,
|
||||
"directories_corp");
|
||||
|
||||
/**
|
||||
* The MIME-type of {@link #CONTENT_URI} providing a directory of
|
||||
* contact directories.
|
||||
@@ -416,6 +424,22 @@ public final class ContactsContract {
|
||||
*/
|
||||
public static final long LOCAL_INVISIBLE = 1;
|
||||
|
||||
/**
|
||||
* _ID of the work profile default directory, which represents locally stored contacts.
|
||||
*
|
||||
* @hide
|
||||
*/
|
||||
public static final long ENTERPRISE_DEFAULT = Directory.ENTERPRISE_DIRECTORY_ID_BASE
|
||||
+ DEFAULT;
|
||||
|
||||
/**
|
||||
* _ID of the work profile directory that represents locally stored invisible contacts.
|
||||
*
|
||||
* @hide
|
||||
*/
|
||||
public static final long ENTERPRISE_LOCAL_INVISIBLE = Directory.ENTERPRISE_DIRECTORY_ID_BASE
|
||||
+ LOCAL_INVISIBLE;
|
||||
|
||||
/**
|
||||
* The name of the package that owns this directory. Contacts Provider
|
||||
* fill it in with the name of the package containing the directory provider.
|
||||
@@ -471,6 +495,15 @@ public final class ContactsContract {
|
||||
*/
|
||||
public static final String ACCOUNT_NAME = "accountName";
|
||||
|
||||
/**
|
||||
* Mimimal ID for corp directory returned from
|
||||
* {@link Directory#CORP_CONTENT_URI}.
|
||||
*
|
||||
* @hide
|
||||
*/
|
||||
// slightly smaller than 2 ** 30
|
||||
public static final long ENTERPRISE_DIRECTORY_ID_BASE = 1000000000;
|
||||
|
||||
/**
|
||||
* One of {@link #EXPORT_SUPPORT_NONE}, {@link #EXPORT_SUPPORT_ANY_ACCOUNT},
|
||||
* {@link #EXPORT_SUPPORT_SAME_ACCOUNT_ONLY}. This is the expectation the
|
||||
@@ -554,6 +587,24 @@ public final class ContactsContract {
|
||||
*/
|
||||
public static final int PHOTO_SUPPORT_FULL = 3;
|
||||
|
||||
/**
|
||||
* Return TRUE if it is a remote stored directory.
|
||||
*/
|
||||
public static boolean isRemoteDirectory(long directoryId) {
|
||||
return directoryId != Directory.DEFAULT
|
||||
&& directoryId != Directory.LOCAL_INVISIBLE
|
||||
&& directoryId != Directory.ENTERPRISE_DEFAULT
|
||||
&& directoryId != Directory.ENTERPRISE_LOCAL_INVISIBLE;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return TRUE if a directory ID is from the contacts provider on the enterprise profile.
|
||||
*
|
||||
*/
|
||||
public static boolean isEnterpriseDirectoryId(long directoryId) {
|
||||
return directoryId >= ENTERPRISE_DIRECTORY_ID_BASE;
|
||||
}
|
||||
|
||||
/**
|
||||
* Notifies the system of a change in the list of directories handled by
|
||||
* a particular directory provider. The Contacts provider will turn around
|
||||
|
||||
Reference in New Issue
Block a user