PolicyUpdateResult


public final class PolicyUpdateResult
extends Object

java.lang.Object
   ↳ android.app.admin.PolicyUpdateResult


Class containing the reason for the policy (set from DevicePolicyManager) update (e.g. success, failure reasons, etc.). This is passed in to PolicyUpdateReceiver.onPolicySetResult) and PolicyUpdateReceiver.onPolicyChanged).

Summary

Constants

int RESULT_FAILURE_CONFLICTING_ADMIN_POLICY

Result code to indicate that the policy has not been enforced or has changed because another admin has set a conflicting policy on the device.

int RESULT_FAILURE_HARDWARE_LIMITATION

Result code to indicate that the policy set by the admin has not been enforced because of a permanent hardware limitation/issue.

int RESULT_FAILURE_STORAGE_LIMIT_REACHED

Result code to indicate that the policy set by the admin has not been enforced because the local storage has reached its max limit.

int RESULT_FAILURE_UNKNOWN

Result code to indicate that the policy has not been enforced or has changed for an unknown reason.

int RESULT_POLICY_CLEARED

Result code to indicate that the policy set by the admin has been successfully cleared, admins will no longer receive policy updates for this policy after this point.

int RESULT_POLICY_SET

Result code to indicate that the policy has been changed to the desired value set by the admin.

Public constructors

PolicyUpdateResult(int resultCode)

Constructor for PolicyUpdateResult that takes in a result code describing why the policy has changed.

Public methods

int getResultCode()

Returns result code describing why the policy has changed.

Inherited methods

Object clone()

Creates and returns a copy of this object.

boolean equals(Object obj)

Indicates whether some other object is "equal to" this one.

void finalize()

Called by the garbage collector on an object when garbage collection determines that there are no more references to the object.

final Class<?> getClass()

Returns the runtime class of this Object.

int hashCode()

Returns a hash code value for the object.

final void notify()

Wakes up a single thread that is waiting on this object's monitor.

final void notifyAll()

Wakes up all threads that are waiting on this object's monitor.

String toString()

Returns a string representation of the object.

final void wait(long timeoutMillis, int nanos)

Causes the current thread to wait until it is awakened, typically by being notified or interrupted, or until a certain amount of real time has elapsed.

final void wait(long timeoutMillis)

Causes the current thread to wait until it is awakened, typically by being notified or interrupted, or until a certain amount of real time has elapsed.

final void wait()

Causes the current thread to wait until it is awakened, typically by being notified or interrupted.

Constants

RESULT_FAILURE_CONFLICTING_ADMIN_POLICY

Added in API level 34
public static final int RESULT_FAILURE_CONFLICTING_ADMIN_POLICY

Result code to indicate that the policy has not been enforced or has changed because another admin has set a conflicting policy on the device.

The system will automatically try to enforce the policy when it can without additional calls from the admin.

Constant Value: 1 (0x00000001)

RESULT_FAILURE_HARDWARE_LIMITATION

Added in API level 34
public static final int RESULT_FAILURE_HARDWARE_LIMITATION

Result code to indicate that the policy set by the admin has not been enforced because of a permanent hardware limitation/issue.

The system will NOT try to automatically store and enforce this policy again.

Constant Value: 4 (0x00000004)

RESULT_FAILURE_STORAGE_LIMIT_REACHED

Added in API level 34
public static final int RESULT_FAILURE_STORAGE_LIMIT_REACHED

Result code to indicate that the policy set by the admin has not been enforced because the local storage has reached its max limit.

The system will NOT try to automatically store and enforce this policy again.

Constant Value: 3 (0x00000003)

RESULT_FAILURE_UNKNOWN

Added in API level 34
public static final int RESULT_FAILURE_UNKNOWN

Result code to indicate that the policy has not been enforced or has changed for an unknown reason.

Constant Value: -1 (0xffffffff)

RESULT_POLICY_CLEARED

Added in API level 34
public static final int RESULT_POLICY_CLEARED

Result code to indicate that the policy set by the admin has been successfully cleared, admins will no longer receive policy updates for this policy after this point.

Note that the policy can still be enforced by some other admin.

Constant Value: 2 (0x00000002)

RESULT_POLICY_SET

Added in API level 34
public static final int RESULT_POLICY_SET

Result code to indicate that the policy has been changed to the desired value set by the admin.

Constant Value: 0 (0x00000000)

Public constructors

PolicyUpdateResult

Added in API level 34
public PolicyUpdateResult (int resultCode)

Constructor for PolicyUpdateResult that takes in a result code describing why the policy has changed.

Public methods

getResultCode

Added in API level 34
public int getResultCode ()

Returns result code describing why the policy has changed.