# DevicePolicyManager.InstallSystemUpdateCallback

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

# InstallSystemUpdateCallback

*** ** * ** ***

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

```
abstract class InstallSystemUpdateCallback
```

|---|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [kotlin.Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html)                                                                                                         ||
| ↳ | [android.app.admin.DevicePolicyManager.InstallSystemUpdateCallback](https://developer.android.com/reference/kotlin/android/app/admin/DevicePolicyManager.InstallSystemUpdateCallback#) |

Callback used in[installSystemUpdate](https://developer.android.com/reference/kotlin/android/app/admin/DevicePolicyManager#installSystemUpdate(android.content.ComponentName,%20android.net.Uri,%20java.util.concurrent.Executor,%20android.app.admin.DevicePolicyManager.InstallSystemUpdateCallback))to indicate that there was an error while trying to install an update.

## Summary

|                                                                                                                                                                        Constants                                                                                                                                                                         ||
|----------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| static[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | [UPDATE_ERROR_BATTERY_LOW](https://developer.android.com/reference/kotlin/android/app/admin/DevicePolicyManager.InstallSystemUpdateCallback#UPDATE_ERROR_BATTERY_LOW:kotlin.Int) Represents the battery being too low to apply an update.                              |
| static[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | [UPDATE_ERROR_FILE_NOT_FOUND](https://developer.android.com/reference/kotlin/android/app/admin/DevicePolicyManager.InstallSystemUpdateCallback#UPDATE_ERROR_FILE_NOT_FOUND:kotlin.Int) Represents that the file could not be found.                                    |
| static[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | [UPDATE_ERROR_INCORRECT_OS_VERSION](https://developer.android.com/reference/kotlin/android/app/admin/DevicePolicyManager.InstallSystemUpdateCallback#UPDATE_ERROR_INCORRECT_OS_VERSION:kotlin.Int) Represents the update file being intended for different OS version. |
| static[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | [UPDATE_ERROR_UNKNOWN](https://developer.android.com/reference/kotlin/android/app/admin/DevicePolicyManager.InstallSystemUpdateCallback#UPDATE_ERROR_UNKNOWN:kotlin.Int) Represents an unknown error while trying to install an update.                                |
| static[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | [UPDATE_ERROR_UPDATE_FILE_INVALID](https://developer.android.com/reference/kotlin/android/app/admin/DevicePolicyManager.InstallSystemUpdateCallback#UPDATE_ERROR_UPDATE_FILE_INVALID:kotlin.Int) Represents the update file being wrong; e.                            |

|                                                                                     Public constructors                                                                                     ||
|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---|
| [InstallSystemUpdateCallback](https://developer.android.com/reference/kotlin/android/app/admin/DevicePolicyManager.InstallSystemUpdateCallback#InstallSystemUpdateCallback())`()` <br /> |

|                                                                                                                                                                                                                                                                  Public methods                                                                                                                                                                                                                                                                  ||
|----------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| open[Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) | [onInstallUpdateError](https://developer.android.com/reference/kotlin/android/app/admin/DevicePolicyManager.InstallSystemUpdateCallback#onInstallUpdateError(kotlin.Int,%20kotlin.String))`(`errorCode:` `[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`, `errorMessage:` `[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)`)` Method invoked when there was an error while installing an update. |

## Constants

### UPDATE_ERROR_BATTERY_LOW

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

```
static val UPDATE_ERROR_BATTERY_LOW: Int
```

Represents the battery being too low to apply an update.  

    Value: 5

### UPDATE_ERROR_FILE_NOT_FOUND

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

```
static val UPDATE_ERROR_FILE_NOT_FOUND: Int
```

Represents that the file could not be found.  

    Value: 4

### UPDATE_ERROR_INCORRECT_OS_VERSION

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

```
static val UPDATE_ERROR_INCORRECT_OS_VERSION: Int
```

Represents the update file being intended for different OS version.  

    Value: 2

### UPDATE_ERROR_UNKNOWN

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

```
static val UPDATE_ERROR_UNKNOWN: Int
```

Represents an unknown error while trying to install an update.  

    Value: 1

### UPDATE_ERROR_UPDATE_FILE_INVALID

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

```
static val UPDATE_ERROR_UPDATE_FILE_INVALID: Int
```

Represents the update file being wrong; e.g. payloads are mismatched, or the wrong compression method is used.  

    Value: 3

## Public constructors

### InstallSystemUpdateCallback

```
InstallSystemUpdateCallback()
```

## Public methods

### onInstallUpdateError

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

```
open fun onInstallUpdateError(
    errorCode: Int, 
    errorMessage: String
): Unit
```

Method invoked when there was an error while installing an update.

The given error message is not intended to be user-facing. It is intended to be reported back to the IT admin to be read.

|                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              Parameters                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              ||
|----------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `errorCode`    | [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html):Value is[android.app.admin.DevicePolicyManager.InstallSystemUpdateCallback#UPDATE_ERROR_UNKNOWN](https://developer.android.com/reference/kotlin/android/app/admin/DevicePolicyManager.InstallSystemUpdateCallback#UPDATE_ERROR_UNKNOWN:kotlin.Int),[android.app.admin.DevicePolicyManager.InstallSystemUpdateCallback#UPDATE_ERROR_INCORRECT_OS_VERSION](https://developer.android.com/reference/kotlin/android/app/admin/DevicePolicyManager.InstallSystemUpdateCallback#UPDATE_ERROR_INCORRECT_OS_VERSION:kotlin.Int),[android.app.admin.DevicePolicyManager.InstallSystemUpdateCallback#UPDATE_ERROR_UPDATE_FILE_INVALID](https://developer.android.com/reference/kotlin/android/app/admin/DevicePolicyManager.InstallSystemUpdateCallback#UPDATE_ERROR_UPDATE_FILE_INVALID:kotlin.Int),[android.app.admin.DevicePolicyManager.InstallSystemUpdateCallback#UPDATE_ERROR_FILE_NOT_FOUND](https://developer.android.com/reference/kotlin/android/app/admin/DevicePolicyManager.InstallSystemUpdateCallback#UPDATE_ERROR_FILE_NOT_FOUND:kotlin.Int), or[android.app.admin.DevicePolicyManager.InstallSystemUpdateCallback#UPDATE_ERROR_BATTERY_LOW](https://developer.android.com/reference/kotlin/android/app/admin/DevicePolicyManager.InstallSystemUpdateCallback#UPDATE_ERROR_BATTERY_LOW:kotlin.Int) |
| `errorMessage` | [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html):This value cannot be`null`.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |