Language

OperationSafetyReason Enum

Definition

Identifies why an operation is unsafe, as reported by UnsafeStateException.

public enum OperationSafetyReason
type OperationSafetyReason = 
Inheritance
OperationSafetyReason

Fields

Name Value Description
None 0

This managed value is 0 and has no matching public Android constant.

DrivingDistraction 1

Indicates that a UnsafeStateException was thrown because the operation would distract the driver of the vehicle.

Android reference for android.app.admin.DevicePolicyManager.OPERATION_SAFETY_REASON_DRIVING_DISTRACTION.

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.

Remarks

DrivingDistraction is the only reason that Android makes public. IsSafeOperation(Int32) and OnOperationSafetyStateChanged(Context, Int32, Boolean) use the Int32 type for the reason. Cast DrivingDistraction when you pass it to IsSafeOperation(Int32).

Applies to