Udostępnij za pośrednictwem


PolicyUpdateReceiver.OnPolicyChanged Method

Definition

Callback triggered when a policy previously set by the admin has changed.

[Android.Runtime.Register("onPolicyChanged", "(Landroid/content/Context;Ljava/lang/String;Landroid/os/Bundle;Landroid/app/admin/TargetUser;Landroid/app/admin/PolicyUpdateResult;)V", "GetOnPolicyChanged_Landroid_content_Context_Ljava_lang_String_Landroid_os_Bundle_Landroid_app_admin_TargetUser_Landroid_app_admin_PolicyUpdateResult_Handler", ApiSince=34)]
public virtual void OnPolicyChanged (Android.Content.Context context, string policyIdentifier, Android.OS.Bundle additionalPolicyParams, Android.App.Admin.TargetUser targetUser, Android.App.Admin.PolicyUpdateResult policyUpdateResult);
[<Android.Runtime.Register("onPolicyChanged", "(Landroid/content/Context;Ljava/lang/String;Landroid/os/Bundle;Landroid/app/admin/TargetUser;Landroid/app/admin/PolicyUpdateResult;)V", "GetOnPolicyChanged_Landroid_content_Context_Ljava_lang_String_Landroid_os_Bundle_Landroid_app_admin_TargetUser_Landroid_app_admin_PolicyUpdateResult_Handler", ApiSince=34)>]
abstract member OnPolicyChanged : Android.Content.Context * string * Android.OS.Bundle * Android.App.Admin.TargetUser * Android.App.Admin.PolicyUpdateResult -> unit
override this.OnPolicyChanged : Android.Content.Context * string * Android.OS.Bundle * Android.App.Admin.TargetUser * Android.App.Admin.PolicyUpdateResult -> unit

Parameters

context
Context

the running context as per #onReceive

policyIdentifier
String

Key to identify which policy this callback relates to.

additionalPolicyParams
Bundle

Bundle containing additional params that may be required to identify some of the policy (e.g. PolicyUpdateReceiver#EXTRA_PACKAGE_NAME and PolicyUpdateReceiver#EXTRA_PERMISSION_NAME). Each policy will document the required additional params if needed.

targetUser
TargetUser

The TargetUser which this policy relates to.

policyUpdateResult
PolicyUpdateResult

Indicates the reason the policy value has changed (e.g. PolicyUpdateResult#RESULT_POLICY_SET if the policy has changed to the value set by the admin, PolicyUpdateResult#RESULT_FAILURE_CONFLICTING_ADMIN_POLICY if the policy has changed because another admin has set a conflicting policy, etc)

Attributes

Remarks

Callback triggered when a policy previously set by the admin has changed.

Admins wishing to receive this callback should include PolicyUpdateReceiver#ACTION_DEVICE_POLICY_CHANGED in the intent filter for their receiver in the manifest, the receiver must be protected by android.Manifest.permission#BIND_DEVICE_ADMIN to ensure that only the system can send updates.

Java documentation for android.app.admin.PolicyUpdateReceiver.onPolicyChanged(android.content.Context, java.lang.String, android.os.Bundle, android.app.admin.TargetUser, android.app.admin.PolicyUpdateResult).

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