# MediaDrm.ErrorCodes

Added in[API level 31](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  
Summary:[Constants](https://developer.android.com/reference/android/media/MediaDrm.ErrorCodes#constants)\|[Inherited Methods](https://developer.android.com/reference/android/media/MediaDrm.ErrorCodes#inhmethods)  

# MediaDrm.ErrorCodes

*** ** * ** ***

[Kotlin](https://developer.android.com/reference/kotlin/android/media/MediaDrm.ErrorCodes "View this page in Kotlin")\|Java

`
public
static
final

class
MediaDrm.ErrorCodes
`  
`

extends `[Object](https://developer.android.com/reference/java/lang/Object)`


``


`

|---|-----------------------------------|
| [java.lang.Object](https://developer.android.com/reference/java/lang/Object) ||
| ↳ | android.media.MediaDrm.ErrorCodes |

<br />

*** ** * ** ***

Error codes that may be returned from[MediaDrm.MediaDrmStateException.getErrorCode()](https://developer.android.com/reference/android/media/MediaDrm.MediaDrmStateException#getErrorCode())and[MediaCodec.CryptoException.getErrorCode()](https://developer.android.com/reference/android/media/MediaCodec.CryptoException#getErrorCode())

The description of each error code includes steps that may be taken to resolve the error condition. For some errors however, a recovery action cannot be predetermined. The description of those codes refers to a general strategy for handling the error condition programmatically, which is to try the following in listed order until successful:

1. retry the operation
2. if the operation is related to a session,[close](https://developer.android.com/reference/android/media/MediaDrm#closeSession(byte[]))the session,[open](https://developer.android.com/reference/android/media/MediaDrm#openSession())a new session, and retry the operation
3. [close](https://developer.android.com/reference/android/media/MediaDrm#close())the[MediaDrm](https://developer.android.com/reference/android/media/MediaDrm)instance and any other related components such as the[codec](https://developer.android.com/reference/android/media/MediaCodec)and retry playback, or
4. try using a different configuration of the[MediaDrm](https://developer.android.com/reference/android/media/MediaDrm)plugin, such as a different[security level](https://developer.android.com/reference/android/media/MediaDrm#openSession(int)).

If the problem still persists after all the aforementioned steps, please report the failure to the[MediaDrm](https://developer.android.com/reference/android/media/MediaDrm)plugin vendor along with the[log messages](https://developer.android.com/reference/android/media/MediaDrm.LogMessage)returned by[MediaDrm.getLogMessages()](https://developer.android.com/reference/android/media/MediaDrm#getLogMessages()), and a bugreport if possible.

## Summary

|                                                                                                                                                                                    ### Constants                                                                                                                                                                                     ||
|-------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `int` | [ERROR_CERTIFICATE_MALFORMED](https://developer.android.com/reference/android/media/MediaDrm.ErrorCodes#ERROR_CERTIFICATE_MALFORMED) Certificate is malformed or is of the wrong type.                                                                                                                                                                                        |
| `int` | [ERROR_CERTIFICATE_MISSING](https://developer.android.com/reference/android/media/MediaDrm.ErrorCodes#ERROR_CERTIFICATE_MISSING) Certificate has not been set.                                                                                                                                                                                                                |
| `int` | [ERROR_CRYPTO_LIBRARY](https://developer.android.com/reference/android/media/MediaDrm.ErrorCodes#ERROR_CRYPTO_LIBRARY) An error happened within the crypto library used by the drm plugin.                                                                                                                                                                                    |
| `int` | [ERROR_FRAME_TOO_LARGE](https://developer.android.com/reference/android/media/MediaDrm.ErrorCodes#ERROR_FRAME_TOO_LARGE) The video frame being decrypted exceeds the size of the device's protected output buffers.                                                                                                                                                           |
| `int` | [ERROR_GENERIC_OEM](https://developer.android.com/reference/android/media/MediaDrm.ErrorCodes#ERROR_GENERIC_OEM) Unexpected error reported by the device OEM subsystem.                                                                                                                                                                                                       |
| `int` | [ERROR_GENERIC_PLUGIN](https://developer.android.com/reference/android/media/MediaDrm.ErrorCodes#ERROR_GENERIC_PLUGIN) Unexpected internal failure in[MediaDrm](https://developer.android.com/reference/android/media/MediaDrm)/[MediaCrypto](https://developer.android.com/reference/android/media/MediaCrypto).                                                             |
| `int` | [ERROR_INIT_DATA](https://developer.android.com/reference/android/media/MediaDrm.ErrorCodes#ERROR_INIT_DATA) The init data parameter passed to[MediaDrm.getKeyRequest](https://developer.android.com/reference/android/media/MediaDrm#getKeyRequest(byte[],%20byte[],%20java.lang.String,%20int,%20java.util.HashMap<java.lang.String,java.lang.String>))is empty or invalid. |
| `int` | [ERROR_INSUFFICIENT_OUTPUT_PROTECTION](https://developer.android.com/reference/android/media/MediaDrm.ErrorCodes#ERROR_INSUFFICIENT_OUTPUT_PROTECTION) The output protection levels supported by the device are not sufficient to meet the requirements set by the content owner in the license policy.                                                                       |
| `int` | [ERROR_INSUFFICIENT_SECURITY](https://developer.android.com/reference/android/media/MediaDrm.ErrorCodes#ERROR_INSUFFICIENT_SECURITY) The security level of the device is not sufficient to meet the requirements set by the content owner in the license policy.                                                                                                              |
| `int` | [ERROR_KEY_EXPIRED](https://developer.android.com/reference/android/media/MediaDrm.ErrorCodes#ERROR_KEY_EXPIRED) The key used for decryption is no longer valid due to license term expiration.                                                                                                                                                                               |
| `int` | [ERROR_KEY_NOT_LOADED](https://developer.android.com/reference/android/media/MediaDrm.ErrorCodes#ERROR_KEY_NOT_LOADED) Either the key was not loaded from the license before attempting the operation, or the key ID parameter provided by the app is incorrect.                                                                                                              |
| `int` | [ERROR_LICENSE_PARSE](https://developer.android.com/reference/android/media/MediaDrm.ErrorCodes#ERROR_LICENSE_PARSE) The license response was empty, fields are missing or otherwise unable to be parsed or decrypted.                                                                                                                                                        |
| `int` | [ERROR_LICENSE_POLICY](https://developer.android.com/reference/android/media/MediaDrm.ErrorCodes#ERROR_LICENSE_POLICY) The operation (e.g. to renew or persist a license) is prohibited by the license policy.                                                                                                                                                                |
| `int` | [ERROR_LICENSE_RELEASE](https://developer.android.com/reference/android/media/MediaDrm.ErrorCodes#ERROR_LICENSE_RELEASE) Failed to generate a release request because a field in the offline license is empty or malformed.                                                                                                                                                   |
| `int` | [ERROR_LICENSE_REQUEST_REJECTED](https://developer.android.com/reference/android/media/MediaDrm.ErrorCodes#ERROR_LICENSE_REQUEST_REJECTED) The license server detected an error in the license request.                                                                                                                                                                       |
| `int` | [ERROR_LICENSE_RESTORE](https://developer.android.com/reference/android/media/MediaDrm.ErrorCodes#ERROR_LICENSE_RESTORE) Failed to restore an offline license because a field in the offline license is empty or malformed.                                                                                                                                                   |
| `int` | [ERROR_LICENSE_STATE](https://developer.android.com/reference/android/media/MediaDrm.ErrorCodes#ERROR_LICENSE_STATE) Offline license is in an invalid state for the attempted operation.                                                                                                                                                                                      |
| `int` | [ERROR_LOST_STATE](https://developer.android.com/reference/android/media/MediaDrm.ErrorCodes#ERROR_LOST_STATE) The session state has been invalidated.                                                                                                                                                                                                                        |
| `int` | [ERROR_MEDIA_FRAMEWORK](https://developer.android.com/reference/android/media/MediaDrm.ErrorCodes#ERROR_MEDIA_FRAMEWORK) Failure in the media framework.                                                                                                                                                                                                                      |
| `int` | [ERROR_NO_KEY](https://developer.android.com/reference/android/media/MediaDrm.ErrorCodes#ERROR_NO_KEY) The requested key was not found when trying to perform a decrypt operation.                                                                                                                                                                                            |
| `int` | [ERROR_PROVISIONING_CERTIFICATE](https://developer.android.com/reference/android/media/MediaDrm.ErrorCodes#ERROR_PROVISIONING_CERTIFICATE) Error loading the provisioned certificate.                                                                                                                                                                                         |
| `int` | [ERROR_PROVISIONING_CONFIG](https://developer.android.com/reference/android/media/MediaDrm.ErrorCodes#ERROR_PROVISIONING_CONFIG) Required steps were not performed before provisioning was attempted.                                                                                                                                                                         |
| `int` | [ERROR_PROVISIONING_PARSE](https://developer.android.com/reference/android/media/MediaDrm.ErrorCodes#ERROR_PROVISIONING_PARSE) The provisioning response was empty, fields are missing or otherwise unable to be parsed.                                                                                                                                                      |
| `int` | [ERROR_PROVISIONING_REQUEST_REJECTED](https://developer.android.com/reference/android/media/MediaDrm.ErrorCodes#ERROR_PROVISIONING_REQUEST_REJECTED) The provisioning server detected an error in the provisioning request.                                                                                                                                                   |
| `int` | [ERROR_PROVISIONING_RETRY](https://developer.android.com/reference/android/media/MediaDrm.ErrorCodes#ERROR_PROVISIONING_RETRY) Provisioning failed in a way that is likely to succeed on a subsequent attempt.                                                                                                                                                                |
| `int` | [ERROR_RESOURCE_BUSY](https://developer.android.com/reference/android/media/MediaDrm.ErrorCodes#ERROR_RESOURCE_BUSY) A required crypto resource was not able to be allocated while attempting the requested operation.                                                                                                                                                        |
| `int` | [ERROR_RESOURCE_CONTENTION](https://developer.android.com/reference/android/media/MediaDrm.ErrorCodes#ERROR_RESOURCE_CONTENTION) This indicates that apps using MediaDrm sessions are temporarily exceeding the capacity of available crypto resources.                                                                                                                       |
| `int` | [ERROR_SECURE_STOP_RELEASE](https://developer.android.com/reference/android/media/MediaDrm.ErrorCodes#ERROR_SECURE_STOP_RELEASE) Failed to generate a secure stop request because a field in the stored license is empty or malformed.                                                                                                                                        |
| `int` | [ERROR_SESSION_NOT_OPENED](https://developer.android.com/reference/android/media/MediaDrm.ErrorCodes#ERROR_SESSION_NOT_OPENED) Decryption was attempted on a session that is not opened, which could be due to a failure to open the session, closing the session prematurely, the session being reclaimed by the resource manager, or a non-existent session id.             |
| `int` | [ERROR_STORAGE_READ](https://developer.android.com/reference/android/media/MediaDrm.ErrorCodes#ERROR_STORAGE_READ) The plugin was unable to read data from the filesystem.                                                                                                                                                                                                    |
| `int` | [ERROR_STORAGE_WRITE](https://developer.android.com/reference/android/media/MediaDrm.ErrorCodes#ERROR_STORAGE_WRITE) The plugin was unable to write data to the filesystem.                                                                                                                                                                                                   |
| `int` | [ERROR_UNKNOWN](https://developer.android.com/reference/android/media/MediaDrm.ErrorCodes#ERROR_UNKNOWN) ERROR_UNKNOWN is used where no other defined error code is applicable to the current failure.                                                                                                                                                                        |
| `int` | [ERROR_UNSUPPORTED_OPERATION](https://developer.android.com/reference/android/media/MediaDrm.ErrorCodes#ERROR_UNSUPPORTED_OPERATION) An operation was attempted that could not be supported by the crypto system of the device in its current configuration.                                                                                                                  |
| `int` | [ERROR_ZERO_SUBSAMPLES](https://developer.android.com/reference/android/media/MediaDrm.ErrorCodes#ERROR_ZERO_SUBSAMPLES) [MediaCodec.queueSecureInputBuffer](https://developer.android.com/reference/android/media/MediaCodec#queueSecureInputBuffer(int,%20int,%20android.media.MediaCodec.CryptoInfo,%20long,%20int))called with 0 subsamples.                              |

| ### Inherited methods |
|-----------------------|---|
| From class` `[java.lang.Object](https://developer.android.com/reference/java/lang/Object)` ` |--------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | ` `[Object](https://developer.android.com/reference/java/lang/Object)          | ` `[clone](https://developer.android.com/reference/java/lang/Object#clone())`() ` Creates and returns a copy of this object.                                                                                                                                                      | | ` boolean`                                                                     | ` `[equals](https://developer.android.com/reference/java/lang/Object#equals(java.lang.Object))`(`[Object](https://developer.android.com/reference/java/lang/Object)` obj) ` Indicates whether some other object is "equal to" this one.                                           | | ` void`                                                                        | ` `[finalize](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 `[Class](https://developer.android.com/reference/java/lang/Class)`<?>` | ` `[getClass](https://developer.android.com/reference/java/lang/Object#getClass())`() ` Returns the runtime class of this`Object`.                                                                                                                                                | | ` int`                                                                         | ` `[hashCode](https://developer.android.com/reference/java/lang/Object#hashCode())`() ` Returns a hash code value for the object.                                                                                                                                                 | | ` final void`                                                                  | ` `[notify](https://developer.android.com/reference/java/lang/Object#notify())`() ` Wakes up a single thread that is waiting on this object's monitor.                                                                                                                            | | ` final void`                                                                  | ` `[notifyAll](https://developer.android.com/reference/java/lang/Object#notifyAll())`() ` Wakes up all threads that are waiting on this object's monitor.                                                                                                                         | | ` `[String](https://developer.android.com/reference/java/lang/String)          | ` `[toString](https://developer.android.com/reference/java/lang/Object#toString())`() ` Returns a string representation of the object.                                                                                                                                            | | ` final void`                                                                  | ` `[wait](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`                                                                  | ` `[wait](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`                                                                  | ` `[wait](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

### ERROR_CERTIFICATE_MALFORMED

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

```
public static final int ERROR_CERTIFICATE_MALFORMED
```

Certificate is malformed or is of the wrong type.

Ensure the certificate provided by the app or returned from the license server is valid. Check with the[MediaDrm](https://developer.android.com/reference/android/media/MediaDrm)plugin vendor for the expected certificate format.

<br />

Constant Value: 10 (0x0000000a)  

### ERROR_CERTIFICATE_MISSING

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

```
public static final int ERROR_CERTIFICATE_MISSING
```

Certificate has not been set.

Ensure the certificate has been provided by the app. Check with the[MediaDrm](https://developer.android.com/reference/android/media/MediaDrm)plugin vendor for the expected method to provide[MediaDrm](https://developer.android.com/reference/android/media/MediaDrm)a certificate.

<br />

Constant Value: 11 (0x0000000b)  

### ERROR_CRYPTO_LIBRARY

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

```
public static final int ERROR_CRYPTO_LIBRARY
```

An error happened within the crypto library used by the drm plugin.

<br />

Constant Value: 12 (0x0000000c)  

### ERROR_FRAME_TOO_LARGE

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

```
public static final int ERROR_FRAME_TOO_LARGE
```

The video frame being decrypted exceeds the size of the device's protected output buffers.

When encountering this error the app should try playing content of a lower resolution or skipping the problematic frame.

<br />

Constant Value: 8 (0x00000008)  

### ERROR_GENERIC_OEM

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

```
public static final int ERROR_GENERIC_OEM
```

Unexpected error reported by the device OEM subsystem.

Please see the general error handling strategy for unexpected errors described in[ErrorCodes](https://developer.android.com/reference/android/media/MediaDrm.ErrorCodes).

<br />

Constant Value: 13 (0x0000000d)  

### ERROR_GENERIC_PLUGIN

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

```
public static final int ERROR_GENERIC_PLUGIN
```

Unexpected internal failure in[MediaDrm](https://developer.android.com/reference/android/media/MediaDrm)/[MediaCrypto](https://developer.android.com/reference/android/media/MediaCrypto).

Please see the general error handling strategy for unexpected errors described in[ErrorCodes](https://developer.android.com/reference/android/media/MediaDrm.ErrorCodes).

<br />

Constant Value: 14 (0x0000000e)  

### ERROR_INIT_DATA

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

```
public static final int ERROR_INIT_DATA
```

The init data parameter passed to[MediaDrm.getKeyRequest](https://developer.android.com/reference/android/media/MediaDrm#getKeyRequest(byte[],%20byte[],%20java.lang.String,%20int,%20java.util.HashMap<java.lang.String,java.lang.String>))is empty or invalid.

Init data is typically obtained from[MediaExtractor.getPsshInfo()](https://developer.android.com/reference/android/media/MediaExtractor#getPsshInfo())or[MediaExtractor.getDrmInitData()](https://developer.android.com/reference/android/media/MediaExtractor#getDrmInitData()). Check with the[MediaDrm](https://developer.android.com/reference/android/media/MediaDrm)plugin vendor for the expected init data format.

<br />

Constant Value: 15 (0x0000000f)  

### ERROR_INSUFFICIENT_OUTPUT_PROTECTION

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

```
public static final int ERROR_INSUFFICIENT_OUTPUT_PROTECTION
```

The output protection levels supported by the device are not sufficient to meet the requirements set by the content owner in the license policy.

<br />

Constant Value: 4 (0x00000004)  

### ERROR_INSUFFICIENT_SECURITY

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

```
public static final int ERROR_INSUFFICIENT_SECURITY
```

The security level of the device is not sufficient to meet the requirements set by the content owner in the license policy.

<br />

Constant Value: 7 (0x00000007)  

### ERROR_KEY_EXPIRED

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

```
public static final int ERROR_KEY_EXPIRED
```

The key used for decryption is no longer valid due to license term expiration.

The operation can be retried after updating the expired keys.

<br />

Constant Value: 2 (0x00000002)  

### ERROR_KEY_NOT_LOADED

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

```
public static final int ERROR_KEY_NOT_LOADED
```

Either the key was not loaded from the license before attempting the operation, or the key ID parameter provided by the app is incorrect.

Ensure the proper keys are in the license, and check the key ID parameter provided by the app is correct. Check with the[MediaDrm](https://developer.android.com/reference/android/media/MediaDrm)plugin vendor for the expected license format.

<br />

Constant Value: 16 (0x00000010)  

### ERROR_LICENSE_PARSE

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

```
public static final int ERROR_LICENSE_PARSE
```

The license response was empty, fields are missing or otherwise unable to be parsed or decrypted.

Check for mistakes such as empty or overwritten buffers. Otherwise, check with the[MediaDrm](https://developer.android.com/reference/android/media/MediaDrm)plugin vendor for the expected license format.

<br />

Constant Value: 17 (0x00000011)  

### ERROR_LICENSE_POLICY

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

```
public static final int ERROR_LICENSE_POLICY
```

The operation (e.g. to renew or persist a license) is prohibited by the license policy.

Check the license policy configuration on the license server.

<br />

Constant Value: 18 (0x00000012)  

### ERROR_LICENSE_RELEASE

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

```
public static final int ERROR_LICENSE_RELEASE
```

Failed to generate a release request because a field in the offline license is empty or malformed.

The license can't be released on the server, but the app may remove the offline license explicitly using[MediaDrm.removeOfflineLicense(byte)](https://developer.android.com/reference/android/media/MediaDrm#removeOfflineLicense(byte[])).

<br />

Constant Value: 19 (0x00000013)  

### ERROR_LICENSE_REQUEST_REJECTED

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

```
public static final int ERROR_LICENSE_REQUEST_REJECTED
```

The license server detected an error in the license request.

Check for errors on the license server.

<br />

Constant Value: 20 (0x00000014)  

### ERROR_LICENSE_RESTORE

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

```
public static final int ERROR_LICENSE_RESTORE
```

Failed to restore an offline license because a field in the offline license is empty or malformed.

Try requesting the license again if the device is online.

<br />

Constant Value: 21 (0x00000015)  

### ERROR_LICENSE_STATE

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

```
public static final int ERROR_LICENSE_STATE
```

Offline license is in an invalid state for the attempted operation.

Check the sequence of API calls made that can affect offline license state. For example, this could happen when the app attempts to restore a license after it has been released.

<br />

Constant Value: 22 (0x00000016)  

### ERROR_LOST_STATE

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

```
public static final int ERROR_LOST_STATE
```

The session state has been invalidated. This can occur on devices that are not capable of retaining crypto session state across device suspend/resume.

The session must be closed and a new session opened to resume operation.

<br />

Constant Value: 9 (0x00000009)  

### ERROR_MEDIA_FRAMEWORK

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

```
public static final int ERROR_MEDIA_FRAMEWORK
```

Failure in the media framework.

Try releasing media resources (e.g.[MediaCodec](https://developer.android.com/reference/android/media/MediaCodec),[MediaDrm](https://developer.android.com/reference/android/media/MediaDrm)), and restarting playback.

<br />

Constant Value: 23 (0x00000017)  

### ERROR_NO_KEY

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

```
public static final int ERROR_NO_KEY
```

The requested key was not found when trying to perform a decrypt operation.

The operation can be retried after adding the correct decryption key.

<br />

Constant Value: 1 (0x00000001)  

### ERROR_PROVISIONING_CERTIFICATE

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

```
public static final int ERROR_PROVISIONING_CERTIFICATE
```

Error loading the provisioned certificate.

Re-provisioning may resolve the problem; check with the[MediaDrm](https://developer.android.com/reference/android/media/MediaDrm)plugin vendor for re-provisioning instructions. Otherwise, using a different security level may resolve the issue.

<br />

Constant Value: 24 (0x00000018)  

### ERROR_PROVISIONING_CONFIG

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

```
public static final int ERROR_PROVISIONING_CONFIG
```

Required steps were not performed before provisioning was attempted.

Ask the[MediaDrm](https://developer.android.com/reference/android/media/MediaDrm)plugin vendor for situations where this error may occur.

<br />

Constant Value: 25 (0x00000019)  

### ERROR_PROVISIONING_PARSE

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

```
public static final int ERROR_PROVISIONING_PARSE
```

The provisioning response was empty, fields are missing or otherwise unable to be parsed.

Check for mistakes such as empty or overwritten buffers. Otherwise, check with the[MediaDrm](https://developer.android.com/reference/android/media/MediaDrm)plugin vendor for the expected provisioning response format.

<br />

Constant Value: 26 (0x0000001a)  

### ERROR_PROVISIONING_REQUEST_REJECTED

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

```
public static final int ERROR_PROVISIONING_REQUEST_REJECTED
```

The provisioning server detected an error in the provisioning request.

Check for errors on the provisioning server.

<br />

Constant Value: 27 (0x0000001b)  

### ERROR_PROVISIONING_RETRY

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

```
public static final int ERROR_PROVISIONING_RETRY
```

Provisioning failed in a way that is likely to succeed on a subsequent attempt.

The app should retry the operation.

<br />

Constant Value: 28 (0x0000001c)  

### ERROR_RESOURCE_BUSY

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

```
public static final int ERROR_RESOURCE_BUSY
```

A required crypto resource was not able to be allocated while attempting the requested operation.

The operation can be retried if the app is able to release resources.

<br />

Constant Value: 3 (0x00000003)  

### ERROR_RESOURCE_CONTENTION

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

```
public static final int ERROR_RESOURCE_CONTENTION
```

This indicates that apps using MediaDrm sessions are temporarily exceeding the capacity of available crypto resources.

The app should retry the operation later.

<br />

Constant Value: 29 (0x0000001d)  

### ERROR_SECURE_STOP_RELEASE

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

```
public static final int ERROR_SECURE_STOP_RELEASE
```

Failed to generate a secure stop request because a field in the stored license is empty or malformed.

The secure stop can't be released on the server, but the app may remove it explicitly using[MediaDrm.removeSecureStop](https://developer.android.com/reference/android/media/MediaDrm#removeSecureStop(byte[])).

<br />

Constant Value: 30 (0x0000001e)  

### ERROR_SESSION_NOT_OPENED

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

```
public static final int ERROR_SESSION_NOT_OPENED
```

Decryption was attempted on a session that is not opened, which could be due to a failure to open the session, closing the session prematurely, the session being reclaimed by the resource manager, or a non-existent session id.

<br />

Constant Value: 5 (0x00000005)  

### ERROR_STORAGE_READ

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

```
public static final int ERROR_STORAGE_READ
```

The plugin was unable to read data from the filesystem.

Please see the general error handling strategy for unexpected errors described in[ErrorCodes](https://developer.android.com/reference/android/media/MediaDrm.ErrorCodes).

<br />

Constant Value: 31 (0x0000001f)  

### ERROR_STORAGE_WRITE

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

```
public static final int ERROR_STORAGE_WRITE
```

The plugin was unable to write data to the filesystem.

Please see the general error handling strategy for unexpected errors described in[ErrorCodes](https://developer.android.com/reference/android/media/MediaDrm.ErrorCodes).

<br />

Constant Value: 32 (0x00000020)  

### ERROR_UNKNOWN

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

```
public static final int ERROR_UNKNOWN
```

ERROR_UNKNOWN is used where no other defined error code is applicable to the current failure.

Please see the general error handling strategy for unexpected errors described in[ErrorCodes](https://developer.android.com/reference/android/media/MediaDrm.ErrorCodes).

<br />

Constant Value: 0 (0x00000000)  

### ERROR_UNSUPPORTED_OPERATION

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

```
public static final int ERROR_UNSUPPORTED_OPERATION
```

An operation was attempted that could not be supported by the crypto system of the device in its current configuration.

This may occur when the license policy requires device security features that aren't supported by the device, or due to an internal error in the crypto system that prevents the specified security policy from being met.

<br />

Constant Value: 6 (0x00000006)  

### ERROR_ZERO_SUBSAMPLES

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

```
public static final int ERROR_ZERO_SUBSAMPLES
```

[MediaCodec.queueSecureInputBuffer](https://developer.android.com/reference/android/media/MediaCodec#queueSecureInputBuffer(int,%20int,%20android.media.MediaCodec.CryptoInfo,%20long,%20int))called with 0 subsamples.

Check the[MediaCodec.CryptoInfo](https://developer.android.com/reference/android/media/MediaCodec.CryptoInfo)object passed to[MediaCodec.queueSecureInputBuffer(int, int, CryptoInfo, long, int)](https://developer.android.com/reference/android/media/MediaCodec#queueSecureInputBuffer(int,%20int,%20android.media.MediaCodec.CryptoInfo,%20long,%20int)).

<br />

Constant Value: 33 (0x00000021)