Udostępnij za pośrednictwem


DevicePolicyManager.SetPermittedAccessibilityServices Method

Definition

Called by a profile or device owner to set the permitted android.accessibilityservice.AccessibilityService.

[Android.Runtime.Register("setPermittedAccessibilityServices", "(Landroid/content/ComponentName;Ljava/util/List;)Z", "GetSetPermittedAccessibilityServices_Landroid_content_ComponentName_Ljava_util_List_Handler")]
public virtual bool SetPermittedAccessibilityServices (Android.Content.ComponentName admin, System.Collections.Generic.IList<string>? packageNames);
[<Android.Runtime.Register("setPermittedAccessibilityServices", "(Landroid/content/ComponentName;Ljava/util/List;)Z", "GetSetPermittedAccessibilityServices_Landroid_content_ComponentName_Ljava_util_List_Handler")>]
abstract member SetPermittedAccessibilityServices : Android.Content.ComponentName * System.Collections.Generic.IList<string> -> bool
override this.SetPermittedAccessibilityServices : Android.Content.ComponentName * System.Collections.Generic.IList<string> -> bool

Parameters

admin
ComponentName

Which DeviceAdminReceiver this request is associated with.

packageNames
IList<String>

List of accessibility service package names.

Returns

true if the operation succeeded, or false if the list didn't contain every enabled non-system accessibility service.

Attributes

Remarks

Called by a profile or device owner to set the permitted android.accessibilityservice.AccessibilityService. When set by 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 accessibility 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.

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 built-in system services. Any non-system accessibility service that's currently enabled must be included in the list.

System accessibility services are always available to the user and this method can't disable them.

Java documentation for android.app.admin.DevicePolicyManager.setPermittedAccessibilityServices(android.content.ComponentName, java.util.List<java.lang.String>).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to