Added in [API level 34](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels) Summary: [Constants](https://developer.android.com/reference/android/app/admin/PolicyUpdateResult#constants) \| [Ctors](https://developer.android.com/reference/android/app/admin/PolicyUpdateResult#pubctors) \| [Methods](https://developer.android.com/reference/android/app/admin/PolicyUpdateResult#pubmethods) \| [Inherited Methods](https://developer.android.com/reference/android/app/admin/PolicyUpdateResult#inhmethods)

# PolicyUpdateResult

*** ** * ** ***


`
public

final

class
PolicyUpdateResult
`


`

extends https://developer.android.com/reference/java/lang/Object


`

`


`

|---|---|
| [java.lang.Object](https://developer.android.com/reference/java/lang/Object) ||
| ↳ | android.app.admin.PolicyUpdateResult |

<br />

*** ** * ** ***

Class containing the reason for the policy (set from `https://developer.android.com/reference/android/app/admin/DevicePolicyManager`) update (e.g.
success, failure reasons, etc.). This is passed in to `https://developer.android.com/reference/android/app/admin/PolicyUpdateReceiver#onPolicySetResult(android.content.Context,%20java.lang.String,%20android.os.Bundle,%20android.app.admin.TargetUser,%20android.app.admin.PolicyUpdateResult)`) and `https://developer.android.com/reference/android/app/admin/PolicyUpdateReceiver#onPolicyChanged(android.content.Context,%20java.lang.String,%20android.os.Bundle,%20android.app.admin.TargetUser,%20android.app.admin.PolicyUpdateResult)`).

## Summary

| ### Constants ||
|---|---|
| `int` | `https://developer.android.com/reference/android/app/admin/PolicyUpdateResult#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` | `https://developer.android.com/reference/android/app/admin/PolicyUpdateResult#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` | `https://developer.android.com/reference/android/app/admin/PolicyUpdateResult#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` | `https://developer.android.com/reference/android/app/admin/PolicyUpdateResult#RESULT_FAILURE_UNKNOWN` Result code to indicate that the policy has not been enforced or has changed for an unknown reason. |
| `int` | `https://developer.android.com/reference/android/app/admin/PolicyUpdateResult#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` | `https://developer.android.com/reference/android/app/admin/PolicyUpdateResult#RESULT_POLICY_SET` Result code to indicate that the policy has been changed to the desired value set by the admin. |

| ### Public constructors ||
|---|---|
| ` https://developer.android.com/reference/android/app/admin/PolicyUpdateResult#PolicyUpdateResult(int)(int resultCode) ` Constructor for `PolicyUpdateResult` that takes in a result code describing why the policy has changed. |

| ### Public methods ||
|---|---|
| ` int` | ` https://developer.android.com/reference/android/app/admin/PolicyUpdateResult#getResultCode()() ` Returns result code describing why the policy has changed. |

### Inherited methods

From class `

https://developer.android.com/reference/java/lang/Object

` `


https://developer.android.com/reference/java/lang/Object` `
https://developer.android.com/reference/java/lang/Object#clone()()
`

Creates and returns a copy of this object.


`


boolean` `
https://developer.android.com/reference/java/lang/Object#equals(java.lang.Object)(https://developer.android.com/reference/java/lang/Object obj)
`

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


`


void` `
https://developer.android.com/reference/java/lang/Object#finalize()()
`

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


`


final

https://developer.android.com/reference/java/lang/Class<?>` `
https://developer.android.com/reference/java/lang/Object#getClass()()
`

Returns the runtime class of this `Object`.


`


int` `
https://developer.android.com/reference/java/lang/Object#hashCode()()
`

Returns a hash code value for the object.


`


final

void` `
https://developer.android.com/reference/java/lang/Object#notify()()
`

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


`


final

void` `
https://developer.android.com/reference/java/lang/Object#notifyAll()()
`

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


`


https://developer.android.com/reference/java/lang/String` `
https://developer.android.com/reference/java/lang/Object#toString()()
`

Returns a string representation of the object.


`


final

void` `
https://developer.android.com/reference/java/lang/Object#wait(long,%20int)(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` `
https://developer.android.com/reference/java/lang/Object#wait(long)(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` `
https://developer.android.com/reference/java/lang/Object#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](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
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.

<br />

Constant Value:

1
(0x00000001)


### RESULT_FAILURE_HARDWARE_LIMITATION

Added in [API level 34](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
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.

<br />

Constant Value:

4
(0x00000004)


### RESULT_FAILURE_STORAGE_LIMIT_REACHED

Added in [API level 34](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
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.

<br />

Constant Value:

3
(0x00000003)


### RESULT_FAILURE_UNKNOWN

Added in [API level 34](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
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.

<br />

Constant Value:

-1
(0xffffffff)


### RESULT_POLICY_CLEARED

Added in [API level 34](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
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.

<br />

Constant Value:

2
(0x00000002)


### RESULT_POLICY_SET

Added in [API level 34](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
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.

<br />

Constant Value:

0
(0x00000000)


## Public constructors

### PolicyUpdateResult

Added in [API level 34](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public PolicyUpdateResult (int resultCode)
```

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

<br />

| Parameters ||
|---|---|
| `resultCode` | `int`: Describes why the policy has changed. Value is one of the following: - `https://developer.android.com/reference/android/app/admin/PolicyUpdateResult#RESULT_FAILURE_UNKNOWN` - `https://developer.android.com/reference/android/app/admin/PolicyUpdateResult#RESULT_POLICY_SET` - `https://developer.android.com/reference/android/app/admin/PolicyUpdateResult#RESULT_FAILURE_CONFLICTING_ADMIN_POLICY` - `https://developer.android.com/reference/android/app/admin/PolicyUpdateResult#RESULT_POLICY_CLEARED` - `https://developer.android.com/reference/android/app/admin/PolicyUpdateResult#RESULT_FAILURE_STORAGE_LIMIT_REACHED` - `https://developer.android.com/reference/android/app/admin/PolicyUpdateResult#RESULT_FAILURE_HARDWARE_LIMITATION` |

## Public methods

### getResultCode

Added in [API level 34](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public int getResultCode ()
```

Returns result code describing why the policy has changed.

<br />

| Returns ||
|---|---|
| `int` | Value is one of the following: - `https://developer.android.com/reference/android/app/admin/PolicyUpdateResult#RESULT_FAILURE_UNKNOWN` - `https://developer.android.com/reference/android/app/admin/PolicyUpdateResult#RESULT_POLICY_SET` - `https://developer.android.com/reference/android/app/admin/PolicyUpdateResult#RESULT_FAILURE_CONFLICTING_ADMIN_POLICY` - `https://developer.android.com/reference/android/app/admin/PolicyUpdateResult#RESULT_POLICY_CLEARED` - `https://developer.android.com/reference/android/app/admin/PolicyUpdateResult#RESULT_FAILURE_STORAGE_LIMIT_REACHED` - `https://developer.android.com/reference/android/app/admin/PolicyUpdateResult#RESULT_FAILURE_HARDWARE_LIMITATION` |