DevicePolicyManager.SetTrustAgentConfiguration Method

Definition

Sets a list of configuration features to enable for a trust agent component.

[Android.Runtime.Register("setTrustAgentConfiguration", "(Landroid/content/ComponentName;Landroid/content/ComponentName;Landroid/os/PersistableBundle;)V", "GetSetTrustAgentConfiguration_Landroid_content_ComponentName_Landroid_content_ComponentName_Landroid_os_PersistableBundle_Handler", ApiSince=23)]
[Android.Runtime.RequiresPermission("android.permission.MANAGE_DEVICE_POLICY_KEYGUARD")]
public virtual void SetTrustAgentConfiguration (Android.Content.ComponentName? admin, Android.Content.ComponentName target, Android.OS.PersistableBundle? configuration);
[<Android.Runtime.Register("setTrustAgentConfiguration", "(Landroid/content/ComponentName;Landroid/content/ComponentName;Landroid/os/PersistableBundle;)V", "GetSetTrustAgentConfiguration_Landroid_content_ComponentName_Landroid_content_ComponentName_Landroid_os_PersistableBundle_Handler", ApiSince=23)>]
[<Android.Runtime.RequiresPermission("android.permission.MANAGE_DEVICE_POLICY_KEYGUARD")>]
abstract member SetTrustAgentConfiguration : Android.Content.ComponentName * Android.Content.ComponentName * Android.OS.PersistableBundle -> unit
override this.SetTrustAgentConfiguration : Android.Content.ComponentName * Android.Content.ComponentName * Android.OS.PersistableBundle -> unit

Parameters

admin
ComponentName

Which DeviceAdminReceiver this request is associated with. Null if the caller is not a device admin

target
ComponentName

Component name of the agent to be configured.

configuration
PersistableBundle

Trust-agent-specific feature configuration bundle. Please consult documentation of the specific trust agent to determine the interpretation of this bundle.

Attributes

Remarks

Sets a list of configuration features to enable for a trust agent component. This is meant to be used in conjunction with #KEYGUARD_DISABLE_TRUST_AGENTS, which disables all trust agents but those enabled by this function call. If flag #KEYGUARD_DISABLE_TRUST_AGENTS is not set, then this call has no effect.

For any specific trust agent, whether it is disabled or not depends on the aggregated state of each admin's #KEYGUARD_DISABLE_TRUST_AGENTS setting and its trust agent configuration as set by this function call. In particular: if any admin sets #KEYGUARD_DISABLE_TRUST_AGENTS and does not additionally set any trust agent configuration, the trust agent is disabled completely. Otherwise, the trust agent will receive the list of configurations from all admins who set #KEYGUARD_DISABLE_TRUST_AGENTS and aggregate the configurations to determine its behavior. The exact meaning of aggregation is trust-agent-specific.

A calling device admin must have requested DeviceAdminInfo#USES_POLICY_DISABLE_KEYGUARD_FEATURES to be able to call this method; if not, a security exception will be thrown.

This method can be called on the DevicePolicyManager instance returned by #getParentProfileInstance(ComponentName) in order to set the configuration for the parent profile.

On devices not supporting PackageManager#FEATURE_SECURE_LOCK_SCREEN feature, calling this method has no effect - no trust agent configuration will be set.

Java documentation for android.app.admin.DevicePolicyManager.setTrustAgentConfiguration(android.content.ComponentName, android.content.ComponentName, android.os.PersistableBundle).

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