Add work contacts directory support in Quick Contacts API
Bug: 25764505
Change-Id: I61f9d13ea03352e3df1686ee4b3bcc43e9a9a760
diff --git a/core/java/android/app/admin/DevicePolicyManager.java b/core/java/android/app/admin/DevicePolicyManager.java
index 0fdf3d3..5c22ed579 100644
--- a/core/java/android/app/admin/DevicePolicyManager.java
+++ b/core/java/android/app/admin/DevicePolicyManager.java
@@ -40,6 +40,7 @@
import android.os.UserHandle;
import android.os.UserManager;
import android.provider.Settings;
+import android.provider.ContactsContract.Directory;
import android.security.Credentials;
import android.service.restrictions.RestrictionsReceiver;
import android.util.Log;
@@ -3202,11 +3203,11 @@
* @hide
*/
public void startManagedQuickContact(String actualLookupKey, long actualContactId,
- Intent originalIntent) {
+ long directoryId, Intent originalIntent) {
if (mService != null) {
try {
mService.startManagedQuickContact(
- actualLookupKey, actualContactId, originalIntent);
+ actualLookupKey, actualContactId, directoryId, originalIntent);
} catch (RemoteException e) {
Log.w(TAG, "Failed talking with device policy service", e);
}
@@ -3214,6 +3215,16 @@
}
/**
+ * Start Quick Contact on the managed profile for the current user, if the policy allows.
+ * @hide
+ */
+ public void startManagedQuickContact(String actualLookupKey, long actualContactId,
+ Intent originalIntent) {
+ startManagedQuickContact(actualLookupKey, actualContactId, Directory.DEFAULT,
+ originalIntent);
+ }
+
+ /**
* Called by a profile owner of a managed profile to set whether bluetooth
* devices can access enterprise contacts.
* <p>