Stay organized with collections
Save and categorize content based on your preferences.
InstallSystemUpdateCallback
abstract class InstallSystemUpdateCallback
Callback used in installSystemUpdate
to indicate that there was an error while trying to install an update.
Summary
Constants |
static Int |
Represents the battery being too low to apply an update.
|
static Int |
Represents that the file could not be found.
|
static Int |
Represents the update file being intended for different OS version.
|
static Int |
Represents an unknown error while trying to install an update.
|
static Int |
Represents the update file being wrong; e.
|
Public methods |
open Unit |
Method invoked when there was an error while installing an update.
|
Constants
UPDATE_ERROR_BATTERY_LOW
static val UPDATE_ERROR_BATTERY_LOW: Int
Represents the battery being too low to apply an update.
Value: 5
UPDATE_ERROR_FILE_NOT_FOUND
static val UPDATE_ERROR_FILE_NOT_FOUND: Int
Represents that the file could not be found.
Value: 4
UPDATE_ERROR_INCORRECT_OS_VERSION
static val UPDATE_ERROR_INCORRECT_OS_VERSION: Int
Represents the update file being intended for different OS version.
Value: 2
UPDATE_ERROR_UNKNOWN
static val UPDATE_ERROR_UNKNOWN: Int
Represents an unknown error while trying to install an update.
Value: 1
UPDATE_ERROR_UPDATE_FILE_INVALID
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
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.
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2025-02-10 UTC.
[null,null,["Last updated 2025-02-10 UTC."],[],[],null,["# DevicePolicyManager.InstallSystemUpdateCallback\n\nAdded in [API level 29](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)\n\nInstallSystemUpdateCallback\n===========================\n\n*** ** * ** ***\n\nKotlin \\|[Java](/reference/android/app/admin/DevicePolicyManager.InstallSystemUpdateCallback \"View this page in Java\") \n\n```\nabstract class InstallSystemUpdateCallback\n```\n\n|---|------------------------------------------------------------------------|\n| [kotlin.Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html) ||\n| ↳ | [android.app.admin.DevicePolicyManager.InstallSystemUpdateCallback](#) |\n\nCallback used in [installSystemUpdate](/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.\n\nSummary\n-------\n\n| Constants ||\n|-----------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------|\n| static [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | [UPDATE_ERROR_BATTERY_LOW](#UPDATE_ERROR_BATTERY_LOW:kotlin.Int) Represents the battery being too low to apply an update. |\n| static [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | [UPDATE_ERROR_FILE_NOT_FOUND](#UPDATE_ERROR_FILE_NOT_FOUND:kotlin.Int) Represents that the file could not be found. |\n| static [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | [UPDATE_ERROR_INCORRECT_OS_VERSION](#UPDATE_ERROR_INCORRECT_OS_VERSION:kotlin.Int) Represents the update file being intended for different OS version. |\n| static [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | [UPDATE_ERROR_UNKNOWN](#UPDATE_ERROR_UNKNOWN:kotlin.Int) Represents an unknown error while trying to install an update. |\n| static [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | [UPDATE_ERROR_UPDATE_FILE_INVALID](#UPDATE_ERROR_UPDATE_FILE_INVALID:kotlin.Int) Represents the update file being wrong; e. |\n\n| Public constructors ||\n|--------------------------------------------------------------------------|---|\n| [InstallSystemUpdateCallback](#InstallSystemUpdateCallback())`()` \u003cbr /\u003e |\n\n| Public methods ||\n|-----------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| open [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) | [onInstallUpdateError](#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. |\n\nConstants\n---------\n\n### UPDATE_ERROR_BATTERY_LOW\n\nAdded in [API level 29](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nstatic val UPDATE_ERROR_BATTERY_LOW: Int\n```\n\nRepresents the battery being too low to apply an update. \n\n Value: 5\n\n### UPDATE_ERROR_FILE_NOT_FOUND\n\nAdded in [API level 29](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nstatic val UPDATE_ERROR_FILE_NOT_FOUND: Int\n```\n\nRepresents that the file could not be found. \n\n Value: 4\n\n### UPDATE_ERROR_INCORRECT_OS_VERSION\n\nAdded in [API level 29](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nstatic val UPDATE_ERROR_INCORRECT_OS_VERSION: Int\n```\n\nRepresents the update file being intended for different OS version. \n\n Value: 2\n\n### UPDATE_ERROR_UNKNOWN\n\nAdded in [API level 29](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nstatic val UPDATE_ERROR_UNKNOWN: Int\n```\n\nRepresents an unknown error while trying to install an update. \n\n Value: 1\n\n### UPDATE_ERROR_UPDATE_FILE_INVALID\n\nAdded in [API level 29](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nstatic val UPDATE_ERROR_UPDATE_FILE_INVALID: Int\n```\n\nRepresents the update file being wrong; e.g. payloads are mismatched, or the wrong compression method is used. \n\n Value: 3\n\nPublic constructors\n-------------------\n\n### InstallSystemUpdateCallback\n\n```\nInstallSystemUpdateCallback()\n```\n\nPublic methods\n--------------\n\n### onInstallUpdateError\n\nAdded in [API level 29](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nopen fun onInstallUpdateError(\n errorCode: Int, \n errorMessage: String\n): Unit\n```\n\nMethod invoked when there was an error while installing an update.\n\nThe given error message is not intended to be user-facing. It is intended to be reported back to the IT admin to be read.\n\n| Parameters ||\n|----------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `errorCode` | [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html): Value is [android.app.admin.DevicePolicyManager.InstallSystemUpdateCallback#UPDATE_ERROR_UNKNOWN](#UPDATE_ERROR_UNKNOWN:kotlin.Int), [android.app.admin.DevicePolicyManager.InstallSystemUpdateCallback#UPDATE_ERROR_INCORRECT_OS_VERSION](#UPDATE_ERROR_INCORRECT_OS_VERSION:kotlin.Int), [android.app.admin.DevicePolicyManager.InstallSystemUpdateCallback#UPDATE_ERROR_UPDATE_FILE_INVALID](#UPDATE_ERROR_UPDATE_FILE_INVALID:kotlin.Int), [android.app.admin.DevicePolicyManager.InstallSystemUpdateCallback#UPDATE_ERROR_FILE_NOT_FOUND](#UPDATE_ERROR_FILE_NOT_FOUND:kotlin.Int), or [android.app.admin.DevicePolicyManager.InstallSystemUpdateCallback#UPDATE_ERROR_BATTERY_LOW](#UPDATE_ERROR_BATTERY_LOW:kotlin.Int) |\n| `errorMessage` | [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html): This value cannot be `null`. |"]]