diff options
| author | Ricky Wai <rickywai@google.com> | 2015-04-14 08:59:15 +0000 |
|---|---|---|
| committer | Android (Google) Code Review <android-gerrit@google.com> | 2015-04-14 08:59:18 +0000 |
| commit | 0c606812c5102fd19eda4b3e1ffbc9e61fec6430 (patch) | |
| tree | 92abcc7212e3f54e234fc13830a2a210b90aee38 /core/java | |
| parent | 8cc578c37b3f8f4f97e96617fda6538852d71628 (diff) | |
| parent | 778ba135380cda90c4c9317c34e875c00e2743a3 (diff) | |
Merge "Add Bluetooth Contacts Sharing policy in DevicePolicyManager"
Diffstat (limited to 'core/java')
| -rw-r--r-- | core/java/android/app/admin/DevicePolicyManager.java | 67 | ||||
| -rw-r--r-- | core/java/android/app/admin/IDevicePolicyManager.aidl | 4 |
2 files changed, 71 insertions, 0 deletions
diff --git a/core/java/android/app/admin/DevicePolicyManager.java b/core/java/android/app/admin/DevicePolicyManager.java index 88b1f2d70265..260c7ffa4663 100644 --- a/core/java/android/app/admin/DevicePolicyManager.java +++ b/core/java/android/app/admin/DevicePolicyManager.java @@ -3254,6 +3254,73 @@ public class DevicePolicyManager { } /** + * Called by a profile owner of a managed profile to set whether bluetooth + * devices can access enterprise contacts. + * <p> + * The calling device admin must be a profile owner. If it is not, a + * security exception will be thrown. + * <p> + * This API works on managed profile only. + * + * @param who Which {@link DeviceAdminReceiver} this request is associated + * with. + * @param disabled If true, bluetooth devices cannot access enterprise + * contacts. + */ + public void setBluetoothContactSharingDisabled(ComponentName who, boolean disabled) { + if (mService != null) { + try { + mService.setBluetoothContactSharingDisabled(who, disabled); + } catch (RemoteException e) { + Log.w(TAG, "Failed talking with device policy service", e); + } + } + } + + /** + * Called by a profile owner of a managed profile to determine whether or + * not Bluetooth devices cannot access enterprise contacts. + * <p> + * The calling device admin must be a profile owner. If it is not, a + * security exception will be thrown. + * <p> + * This API works on managed profile only. + * + * @param who Which {@link DeviceAdminReceiver} this request is associated + * with. + */ + public boolean getBluetoothContactSharingDisabled(ComponentName who) { + if (mService != null) { + try { + return mService.getBluetoothContactSharingDisabled(who); + } catch (RemoteException e) { + Log.w(TAG, "Failed talking with device policy service", e); + } + } + return true; + } + + /** + * Determine whether or not Bluetooth devices cannot access contacts. + * <p> + * This API works on managed profile UserHandle only. + * + * @param userHandle The user for whom to check the caller-id permission + * @hide + */ + public boolean getBluetoothContactSharingDisabled(UserHandle userHandle) { + if (mService != null) { + try { + return mService.getBluetoothContactSharingDisabledForUser(userHandle + .getIdentifier()); + } catch (RemoteException e) { + Log.w(TAG, "Failed talking with device policy service", e); + } + } + return true; + } + + /** * Called by the profile owner of a managed profile so that some intents sent in the managed * profile can also be resolved in the parent, or vice versa. * Only activity intents are supported. diff --git a/core/java/android/app/admin/IDevicePolicyManager.aidl b/core/java/android/app/admin/IDevicePolicyManager.aidl index 75b97a86d2d1..e23601082ce3 100644 --- a/core/java/android/app/admin/IDevicePolicyManager.aidl +++ b/core/java/android/app/admin/IDevicePolicyManager.aidl @@ -191,6 +191,10 @@ interface IDevicePolicyManager { boolean getCrossProfileCallerIdDisabledForUser(int userId); void startManagedQuickContact(String lookupKey, long contactId, in Intent originalIntent); + void setBluetoothContactSharingDisabled(in ComponentName who, boolean disabled); + boolean getBluetoothContactSharingDisabled(in ComponentName who); + boolean getBluetoothContactSharingDisabledForUser(int userId); + void setTrustAgentConfiguration(in ComponentName admin, in ComponentName agent, in PersistableBundle args); List<PersistableBundle> getTrustAgentConfiguration(in ComponentName admin, |
