Condividi tramite


DeviceAdminReceiver.OnOperationSafetyStateChanged Method

Definition

Called to notify the state of operations that can be unsafe to execute has changed.

[Android.Runtime.Register("onOperationSafetyStateChanged", "(Landroid/content/Context;IZ)V", "GetOnOperationSafetyStateChanged_Landroid_content_Context_IZHandler", ApiSince=31)]
public virtual void OnOperationSafetyStateChanged (Android.Content.Context context, int reason, bool isSafe);
[<Android.Runtime.Register("onOperationSafetyStateChanged", "(Landroid/content/Context;IZ)V", "GetOnOperationSafetyStateChanged_Landroid_content_Context_IZHandler", ApiSince=31)>]
abstract member OnOperationSafetyStateChanged : Android.Content.Context * int * bool -> unit
override this.OnOperationSafetyStateChanged : Android.Content.Context * int * bool -> unit

Parameters

context
Context

the running context as per #onReceive

reason
Int32

the reason an operation could be unsafe.

isSafe
Boolean

whether the operation is safe to be executed.

Attributes

Remarks

Called to notify the state of operations that can be unsafe to execute has changed.

<b>Note:/b> notice that the operation safety state might change between the time this callback is received and the operation's method on DevicePolicyManager is called, so calls to the latter could still throw a UnsafeStateException even when this method is called with isSafe as true

Java documentation for android.app.admin.DeviceAdminReceiver.onOperationSafetyStateChanged(android.content.Context, int, boolean).

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