# SystemUpdatePolicy.ValidationFailedException

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

# ValidationFailedException

*** ** * ** ***

Kotlin\|[Java](https://developer.android.com/reference/android/app/admin/SystemUpdatePolicy.ValidationFailedException "View this page in Java")  

```
class ValidationFailedException : IllegalArgumentException, Parcelable
```

|---|---|---|---|---|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [kotlin.Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html)                                                                                                               ||||||
| ↳ | [kotlin.Throwable](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-throwable/index.html)                                                                                                |||||
|   | ↳ | [java.lang.Exception](https://developer.android.com/reference/kotlin/java/lang/Exception.html#)                                                                                           ||||
|   |   | ↳ | [java.lang.RuntimeException](https://developer.android.com/reference/kotlin/java/lang/RuntimeException.html#)                                                                          |||
|   |   |   | ↳ | [java.lang.IllegalArgumentException](https://developer.android.com/reference/kotlin/java/lang/IllegalArgumentException.html#)                                                       ||
|   |   |   |   | ↳ | [android.app.admin.SystemUpdatePolicy.ValidationFailedException](https://developer.android.com/reference/kotlin/android/app/admin/SystemUpdatePolicy.ValidationFailedException#) |

An exception class that represents various validation errors thrown from[SystemUpdatePolicy.setFreezePeriods](https://developer.android.com/reference/kotlin/android/app/admin/SystemUpdatePolicy#setFreezePeriods(kotlin.collections.MutableList))and[DevicePolicyManager.setSystemUpdatePolicy](https://developer.android.com/reference/kotlin/android/app/admin/DevicePolicyManager#setSystemUpdatePolicy(android.content.ComponentName,%20android.app.admin.SystemUpdatePolicy))

## Summary

|                                                                                                                                                                                                                           Constants                                                                                                                                                                                                                            ||
|----------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| static[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | [ERROR_COMBINED_FREEZE_PERIOD_TOO_CLOSE](https://developer.android.com/reference/kotlin/android/app/admin/SystemUpdatePolicy.ValidationFailedException#ERROR_COMBINED_FREEZE_PERIOD_TOO_CLOSE:kotlin.Int) The device has been in a freeze period and some new freeze period to be set is less than 60 days from the end of the last freeze period the device went through.   |
| static[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | [ERROR_COMBINED_FREEZE_PERIOD_TOO_LONG](https://developer.android.com/reference/kotlin/android/app/admin/SystemUpdatePolicy.ValidationFailedException#ERROR_COMBINED_FREEZE_PERIOD_TOO_LONG:kotlin.Int) The device has been in a freeze period and when combining with the new freeze period to be set, it will result in the total freeze period being longer than 90 days. |
| static[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | [ERROR_DUPLICATE_OR_OVERLAP](https://developer.android.com/reference/kotlin/android/app/admin/SystemUpdatePolicy.ValidationFailedException#ERROR_DUPLICATE_OR_OVERLAP:kotlin.Int) The freeze periods contains duplicates, periods that overlap with each other or periods whose start and end joins.                                                                         |
| static[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | [ERROR_NEW_FREEZE_PERIOD_TOO_CLOSE](https://developer.android.com/reference/kotlin/android/app/admin/SystemUpdatePolicy.ValidationFailedException#ERROR_NEW_FREEZE_PERIOD_TOO_CLOSE:kotlin.Int) There exists some freeze period which starts within 60 days of the preceding period's end time.                                                                              |
| static[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | [ERROR_NEW_FREEZE_PERIOD_TOO_LONG](https://developer.android.com/reference/kotlin/android/app/admin/SystemUpdatePolicy.ValidationFailedException#ERROR_NEW_FREEZE_PERIOD_TOO_LONG:kotlin.Int) There exists at least one freeze period whose length exceeds 90 days.                                                                                                          |
| static[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | [ERROR_UNKNOWN](https://developer.android.com/reference/kotlin/android/app/admin/SystemUpdatePolicy.ValidationFailedException#ERROR_UNKNOWN:kotlin.Int) Validation failed with unknown error.                                                                                                                                                                                |

| Inherited constants ||
|---|---|
| From class[Parcelable](https://developer.android.com/reference/kotlin/android/os/Parcelable.html#) |----------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | [CONTENTS_FILE_DESCRIPTOR](https://developer.android.com/reference/kotlin/android/os/Parcelable.html#CONTENTS_FILE_DESCRIPTOR:kotlin.Int) <br /> Descriptor bit used with[describeContents()](https://developer.android.com/reference/kotlin/android/os/Parcelable.html#describeContents()): indicates that the Parcelable object's flattened representation includes a file descriptor. <br />                                                                                                                                                                                                        | | [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | [PARCELABLE_WRITE_RETURN_VALUE](https://developer.android.com/reference/kotlin/android/os/Parcelable.html#PARCELABLE_WRITE_RETURN_VALUE:kotlin.Int) <br /> Flag for use with[writeToParcel](https://developer.android.com/reference/kotlin/android/os/Parcelable.html#writeToParcel(android.os.Parcel,%20kotlin.Int)): the object being written is a return value, that is the result of a function such as "`Parcelable someFunction()`", "`void someFunction(out Parcelable)`", or "`void someFunction(inout Parcelable)`". Some implementations may want to release resources at this point. <br /> | ||

|                                                                                                                                                                                                                     Public methods                                                                                                                                                                                                                      ||
|------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)   | [describeContents](https://developer.android.com/reference/kotlin/android/app/admin/SystemUpdatePolicy.ValidationFailedException#describeContents())`()` <br />                                                                                                                                                                                                           |
| [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)   | [getErrorCode](https://developer.android.com/reference/kotlin/android/app/admin/SystemUpdatePolicy.ValidationFailedException#getErrorCode())`()` Returns the type of validation error associated with this exception.                                                                                                                                                     |
| [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) | [writeToParcel](https://developer.android.com/reference/kotlin/android/app/admin/SystemUpdatePolicy.ValidationFailedException#writeToParcel(android.os.Parcel,%20kotlin.Int))`(`dest:` `[Parcel](https://developer.android.com/reference/kotlin/android/os/Parcel.html#)`, `flags:` `[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`)` <br /> |

|                                                                                                                                                                                                                        Properties                                                                                                                                                                                                                        ||
|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| static[Parcelable.Creator](https://developer.android.com/reference/kotlin/android/os/Parcelable.Creator.html#)\<[SystemUpdatePolicy.ValidationFailedException](https://developer.android.com/reference/kotlin/android/app/admin/SystemUpdatePolicy.ValidationFailedException#)!\> | [CREATOR](https://developer.android.com/reference/kotlin/android/app/admin/SystemUpdatePolicy.ValidationFailedException#CREATOR:android.os.Parcelable.Creator) <br /> |

## Constants

### ERROR_COMBINED_FREEZE_PERIOD_TOO_CLOSE

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

```
static val ERROR_COMBINED_FREEZE_PERIOD_TOO_CLOSE: Int
```

The device has been in a freeze period and some new freeze period to be set is less than 60 days from the end of the last freeze period the device went through.  

    Value: 6

### ERROR_COMBINED_FREEZE_PERIOD_TOO_LONG

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

```
static val ERROR_COMBINED_FREEZE_PERIOD_TOO_LONG: Int
```

The device has been in a freeze period and when combining with the new freeze period to be set, it will result in the total freeze period being longer than 90 days.  

    Value: 5

### ERROR_DUPLICATE_OR_OVERLAP

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

```
static val ERROR_DUPLICATE_OR_OVERLAP: Int
```

The freeze periods contains duplicates, periods that overlap with each other or periods whose start and end joins.  

    Value: 2

### ERROR_NEW_FREEZE_PERIOD_TOO_CLOSE

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

```
static val ERROR_NEW_FREEZE_PERIOD_TOO_CLOSE: Int
```

There exists some freeze period which starts within 60 days of the preceding period's end time.  

    Value: 4

### ERROR_NEW_FREEZE_PERIOD_TOO_LONG

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

```
static val ERROR_NEW_FREEZE_PERIOD_TOO_LONG: Int
```

There exists at least one freeze period whose length exceeds 90 days.  

    Value: 3

### ERROR_UNKNOWN

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

```
static val ERROR_UNKNOWN: Int
```

Validation failed with unknown error.  

    Value: 1

## Public methods

### describeContents

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

```
fun describeContents(): Int
```

|                                                                                                                                                                               Return                                                                                                                                                                               ||
|----------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | a bitmask indicating the set of special object types marshaled by this Parcelable object instance. Value is either`0`or[android.os.Parcelable#CONTENTS_FILE_DESCRIPTOR](https://developer.android.com/reference/kotlin/android/os/Parcelable.html#CONTENTS_FILE_DESCRIPTOR:kotlin.Int) |

### getErrorCode

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

```
fun getErrorCode(): Int
```

Returns the type of validation error associated with this exception.

|                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        Return                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         ||
|----------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | Value is android.app.admin.SystemUpdatePolicy.ValidationFailedException.ERROR_NONE,[android.app.admin.SystemUpdatePolicy.ValidationFailedException#ERROR_DUPLICATE_OR_OVERLAP](https://developer.android.com/reference/kotlin/android/app/admin/SystemUpdatePolicy.ValidationFailedException#ERROR_DUPLICATE_OR_OVERLAP:kotlin.Int),[android.app.admin.SystemUpdatePolicy.ValidationFailedException#ERROR_NEW_FREEZE_PERIOD_TOO_LONG](https://developer.android.com/reference/kotlin/android/app/admin/SystemUpdatePolicy.ValidationFailedException#ERROR_NEW_FREEZE_PERIOD_TOO_LONG:kotlin.Int),[android.app.admin.SystemUpdatePolicy.ValidationFailedException#ERROR_NEW_FREEZE_PERIOD_TOO_CLOSE](https://developer.android.com/reference/kotlin/android/app/admin/SystemUpdatePolicy.ValidationFailedException#ERROR_NEW_FREEZE_PERIOD_TOO_CLOSE:kotlin.Int),[android.app.admin.SystemUpdatePolicy.ValidationFailedException#ERROR_COMBINED_FREEZE_PERIOD_TOO_LONG](https://developer.android.com/reference/kotlin/android/app/admin/SystemUpdatePolicy.ValidationFailedException#ERROR_COMBINED_FREEZE_PERIOD_TOO_LONG:kotlin.Int),[android.app.admin.SystemUpdatePolicy.ValidationFailedException#ERROR_COMBINED_FREEZE_PERIOD_TOO_CLOSE](https://developer.android.com/reference/kotlin/android/app/admin/SystemUpdatePolicy.ValidationFailedException#ERROR_COMBINED_FREEZE_PERIOD_TOO_CLOSE:kotlin.Int), or[android.app.admin.SystemUpdatePolicy.ValidationFailedException#ERROR_UNKNOWN](https://developer.android.com/reference/kotlin/android/app/admin/SystemUpdatePolicy.ValidationFailedException#ERROR_UNKNOWN:kotlin.Int) |

### writeToParcel

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

```
fun writeToParcel(
    dest: Parcel, 
    flags: Int
): Unit
```

|                                                                                                                                                                                                                                                                                     Parameters                                                                                                                                                                                                                                                                                     ||
|---------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `dest`  | [Parcel](https://developer.android.com/reference/kotlin/android/os/Parcel.html#):The Parcel in which the object should be written. This value cannot be`null`.                                                                                                                                                                                                                                                                                                                                                                                                            |
| `flags` | [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html):Additional flags about how the object should be written. May be 0 or[PARCELABLE_WRITE_RETURN_VALUE](https://developer.android.com/reference/kotlin/android/os/Parcelable.html#PARCELABLE_WRITE_RETURN_VALUE:kotlin.Int). Value is either`0`or a combination of[android.os.Parcelable#PARCELABLE_WRITE_RETURN_VALUE](https://developer.android.com/reference/kotlin/android/os/Parcelable.html#PARCELABLE_WRITE_RETURN_VALUE:kotlin.Int), and android.os.Parcelable.PARCELABLE_ELIDE_DUPLICATES |

## Properties

### CREATOR

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

```
static val CREATOR: Parcelable.Creator<SystemUpdatePolicy.ValidationFailedException!>
```