Merge "Improve javadocs of some DPM APIs" into pi-dev

This commit is contained in:
TreeHugger Robot
2018-03-05 23:16:14 +00:00
committed by Android (Google) Code Review

View File

@@ -2865,7 +2865,7 @@ public class DevicePolicyManager {
* false if the profile has empty password as a separate challenge. * false if the profile has empty password as a separate challenge.
* *
* @param admin Which {@link DeviceAdminReceiver} this request is associated with. * @param admin Which {@link DeviceAdminReceiver} this request is associated with.
* @throws SecurityException if {@code admin} is not a profile owner of a managed profile. * @throws SecurityException if {@code admin} is not a profile owner.
* @see UserManager#DISALLOW_UNIFIED_PASSWORD * @see UserManager#DISALLOW_UNIFIED_PASSWORD
*/ */
public boolean isUsingUnifiedPassword(@NonNull ComponentName admin) { public boolean isUsingUnifiedPassword(@NonNull ComponentName admin) {
@@ -5579,10 +5579,13 @@ public class DevicePolicyManager {
} }
/** /**
* Called by a profile owner or device owner to add a default intent handler activity for * Called by a profile owner or device owner to set a default activity that the system selects
* intents that match a certain intent filter. This activity will remain the default intent * to handle intents that match the given {@link IntentFilter}. This activity will remain the
* handler even if the set of potential event handlers for the intent filter changes and if the * default intent handler even if the set of potential event handlers for the intent filter
* intent preferences are reset. * changes and if the intent preferences are reset.
* <p>
* Note that the caller should still declare the activity in the manifest, the API just sets
* the activity to be the default one to handle the given intent filter.
* <p> * <p>
* The default disambiguation mechanism takes over if the activity is not installed (anymore). * The default disambiguation mechanism takes over if the activity is not installed (anymore).
* When the activity is (re)installed, it is automatically reset as default intent handler for * When the activity is (re)installed, it is automatically reset as default intent handler for
@@ -5878,7 +5881,7 @@ public class DevicePolicyManager {
* *
* @param admin Which {@link DeviceAdminReceiver} this request is associated with. * @param admin Which {@link DeviceAdminReceiver} this request is associated with.
* @param disabled If true caller-Id information in the managed profile is not displayed. * @param disabled If true caller-Id information in the managed profile is not displayed.
* @throws SecurityException if {@code admin} is not a device or profile owner. * @throws SecurityException if {@code admin} is not a profile owner.
*/ */
public void setCrossProfileCallerIdDisabled(@NonNull ComponentName admin, boolean disabled) { public void setCrossProfileCallerIdDisabled(@NonNull ComponentName admin, boolean disabled) {
throwIfParentInstance("setCrossProfileCallerIdDisabled"); throwIfParentInstance("setCrossProfileCallerIdDisabled");
@@ -5899,7 +5902,7 @@ public class DevicePolicyManager {
* thrown. * thrown.
* *
* @param admin Which {@link DeviceAdminReceiver} this request is associated with. * @param admin Which {@link DeviceAdminReceiver} this request is associated with.
* @throws SecurityException if {@code admin} is not a device or profile owner. * @throws SecurityException if {@code admin} is not a profile owner.
*/ */
public boolean getCrossProfileCallerIdDisabled(@NonNull ComponentName admin) { public boolean getCrossProfileCallerIdDisabled(@NonNull ComponentName admin) {
throwIfParentInstance("getCrossProfileCallerIdDisabled"); throwIfParentInstance("getCrossProfileCallerIdDisabled");
@@ -5939,7 +5942,7 @@ public class DevicePolicyManager {
* *
* @param admin Which {@link DeviceAdminReceiver} this request is associated with. * @param admin Which {@link DeviceAdminReceiver} this request is associated with.
* @param disabled If true contacts search in the managed profile is not displayed. * @param disabled If true contacts search in the managed profile is not displayed.
* @throws SecurityException if {@code admin} is not a device or profile owner. * @throws SecurityException if {@code admin} is not a profile owner.
*/ */
public void setCrossProfileContactsSearchDisabled(@NonNull ComponentName admin, public void setCrossProfileContactsSearchDisabled(@NonNull ComponentName admin,
boolean disabled) { boolean disabled) {
@@ -5961,7 +5964,7 @@ public class DevicePolicyManager {
* thrown. * thrown.
* *
* @param admin Which {@link DeviceAdminReceiver} this request is associated with. * @param admin Which {@link DeviceAdminReceiver} this request is associated with.
* @throws SecurityException if {@code admin} is not a device or profile owner. * @throws SecurityException if {@code admin} is not a profile owner.
*/ */
public boolean getCrossProfileContactsSearchDisabled(@NonNull ComponentName admin) { public boolean getCrossProfileContactsSearchDisabled(@NonNull ComponentName admin) {
throwIfParentInstance("getCrossProfileContactsSearchDisabled"); throwIfParentInstance("getCrossProfileContactsSearchDisabled");
@@ -6032,7 +6035,7 @@ public class DevicePolicyManager {
* *
* @param admin Which {@link DeviceAdminReceiver} this request is associated with. * @param admin Which {@link DeviceAdminReceiver} this request is associated with.
* @param disabled If true, bluetooth devices cannot access enterprise contacts. * @param disabled If true, bluetooth devices cannot access enterprise contacts.
* @throws SecurityException if {@code admin} is not a device or profile owner. * @throws SecurityException if {@code admin} is not a profile owner.
*/ */
public void setBluetoothContactSharingDisabled(@NonNull ComponentName admin, boolean disabled) { public void setBluetoothContactSharingDisabled(@NonNull ComponentName admin, boolean disabled) {
throwIfParentInstance("setBluetoothContactSharingDisabled"); throwIfParentInstance("setBluetoothContactSharingDisabled");
@@ -6055,7 +6058,7 @@ public class DevicePolicyManager {
* This API works on managed profile only. * This API works on managed profile only.
* *
* @param admin Which {@link DeviceAdminReceiver} this request is associated with. * @param admin Which {@link DeviceAdminReceiver} this request is associated with.
* @throws SecurityException if {@code admin} is not a device or profile owner. * @throws SecurityException if {@code admin} is not a profile owner.
*/ */
public boolean getBluetoothContactSharingDisabled(@NonNull ComponentName admin) { public boolean getBluetoothContactSharingDisabled(@NonNull ComponentName admin) {
throwIfParentInstance("getBluetoothContactSharingDisabled"); throwIfParentInstance("getBluetoothContactSharingDisabled");
@@ -6125,7 +6128,7 @@ public class DevicePolicyManager {
* {@link UserManager#DISALLOW_SHARE_INTO_MANAGED_PROFILE}. * {@link UserManager#DISALLOW_SHARE_INTO_MANAGED_PROFILE}.
* *
* @param admin Which {@link DeviceAdminReceiver} this request is associated with. * @param admin Which {@link DeviceAdminReceiver} this request is associated with.
* @throws SecurityException if {@code admin} is not a device or profile owner. * @throws SecurityException if {@code admin} is not a profile owner.
*/ */
public void clearCrossProfileIntentFilters(@NonNull ComponentName admin) { public void clearCrossProfileIntentFilters(@NonNull ComponentName admin) {
throwIfParentInstance("clearCrossProfileIntentFilters"); throwIfParentInstance("clearCrossProfileIntentFilters");
@@ -6139,21 +6142,22 @@ public class DevicePolicyManager {
} }
/** /**
* Called by a profile or device owner to set the permitted accessibility services. When set by * Called by a profile or device owner to set the permitted
* {@link android.accessibilityservice.AccessibilityService}. When set by
* a device owner or profile owner the restriction applies to all profiles of the user the * a device owner or profile owner the restriction applies to all profiles of the user the
* device owner or profile owner is an admin for. By default the user can use any accessiblity * device owner or profile owner is an admin for. By default, the user can use any accessibility
* service. When zero or more packages have been added, accessiblity services that are not in * service. When zero or more packages have been added, accessibility services that are not in
* the list and not part of the system can not be enabled by the user. * the list and not part of the system can not be enabled by the user.
* <p> * <p>
* Calling with a null value for the list disables the restriction so that all services can be * Calling with a null value for the list disables the restriction so that all services can be
* used, calling with an empty list only allows the builtin system's services. * used, calling with an empty list only allows the built-in system services. Any non-system
* accessibility service that's currently enabled must be included in the list.
* <p> * <p>
* System accessibility services are always available to the user the list can't modify this. * System accessibility services are always available to the user the list can't modify this.
*
* @param admin Which {@link DeviceAdminReceiver} this request is associated with. * @param admin Which {@link DeviceAdminReceiver} this request is associated with.
* @param packageNames List of accessibility service package names. * @param packageNames List of accessibility service package names.
* @return true if setting the restriction succeeded. It fail if there is one or more non-system * @return {@code true} if the operation succeeded, or {@code false} if the list didn't
* accessibility services enabled, that are not in the list. * contain every enabled non-system accessibility service.
* @throws SecurityException if {@code admin} is not a device or profile owner. * @throws SecurityException if {@code admin} is not a device or profile owner.
*/ */
public boolean setPermittedAccessibilityServices(@NonNull ComponentName admin, public boolean setPermittedAccessibilityServices(@NonNull ComponentName admin,
@@ -6242,10 +6246,11 @@ public class DevicePolicyManager {
/** /**
* Called by a profile or device owner to set the permitted input methods services. When set by * Called by a profile or device owner to set the permitted input methods services. When set by
* a device owner or profile owner the restriction applies to all profiles of the user the * a device owner or profile owner the restriction applies to all profiles of the user the
* device owner or profile owner is an admin for. By default the user can use any input method. * device owner or profile owner is an admin for. By default, the user can use any input method.
* When zero or more packages have been added, input method that are not in the list and not * When zero or more packages have been added, input method that are not in the list and not
* part of the system can not be enabled by the user. This method will fail if it is called for * part of the system can not be enabled by the user. This method will fail if it is called for
* a admin that is not for the foreground user or a profile of the foreground user. * a admin that is not for the foreground user or a profile of the foreground user. Any
* non-system input method service that's currently enabled must be included in the list.
* <p> * <p>
* Calling with a null value for the list disables the restriction so that all input methods can * Calling with a null value for the list disables the restriction so that all input methods can
* be used, calling with an empty list disables all but the system's own input methods. * be used, calling with an empty list disables all but the system's own input methods.
@@ -6254,8 +6259,8 @@ public class DevicePolicyManager {
* *
* @param admin Which {@link DeviceAdminReceiver} this request is associated with. * @param admin Which {@link DeviceAdminReceiver} this request is associated with.
* @param packageNames List of input method package names. * @param packageNames List of input method package names.
* @return true if setting the restriction succeeded. It will fail if there are one or more * @return {@code true} if the operation succeeded, or {@code false} if the list didn't
* non-system input methods currently enabled that are not in the packageNames list. * contain every enabled non-system input method service.
* @throws SecurityException if {@code admin} is not a device or profile owner. * @throws SecurityException if {@code admin} is not a device or profile owner.
*/ */
public boolean setPermittedInputMethods( public boolean setPermittedInputMethods(
@@ -7854,11 +7859,14 @@ public class DevicePolicyManager {
* {@link #PERMISSION_GRANT_STATE_DEFAULT default} in which a user can manage it through the UI, * {@link #PERMISSION_GRANT_STATE_DEFAULT default} in which a user can manage it through the UI,
* {@link #PERMISSION_GRANT_STATE_DENIED denied}, in which the permission is denied and the user * {@link #PERMISSION_GRANT_STATE_DENIED denied}, in which the permission is denied and the user
* cannot manage it through the UI, and {@link #PERMISSION_GRANT_STATE_GRANTED granted} in which * cannot manage it through the UI, and {@link #PERMISSION_GRANT_STATE_GRANTED granted} in which
* the permission is granted and the user cannot manage it through the UI. This might affect all * the permission is granted and the user cannot manage it through the UI. This method can only
* permissions in a group that the runtime permission belongs to. This method can only be called * be called by a profile owner, device owner, or a delegate given the
* by a profile owner, device owner, or a delegate given the
* {@link #DELEGATION_PERMISSION_GRANT} scope via {@link #setDelegatedScopes}. * {@link #DELEGATION_PERMISSION_GRANT} scope via {@link #setDelegatedScopes}.
* <p/> * <p/>
* Note that user cannot manage other permissions in the affected group through the UI
* either and their granted state will be kept as the current value. Thus, it's recommended that
* you set the grant state of all the permissions in the affected group.
* <p/>
* Setting the grant state to {@link #PERMISSION_GRANT_STATE_DEFAULT default} does not revoke * Setting the grant state to {@link #PERMISSION_GRANT_STATE_DEFAULT default} does not revoke
* the permission. It retains the previous grant, if any. * the permission. It retains the previous grant, if any.
* <p/> * <p/>