Added in API level 21

MediaDrm.MediaDrmStateException

public static final class MediaDrm.MediaDrmStateException
extends IllegalStateException implements MediaDrmThrowable

java.lang.Object
   ↳ java.lang.Throwable
     ↳ java.lang.Exception
       ↳ java.lang.RuntimeException
         ↳ java.lang.IllegalStateException
           ↳ android.media.MediaDrm.MediaDrmStateException


Thrown when a general failure occurs during a MediaDrm operation. Extends IllegalStateException with the addition of an error code that may be useful in diagnosing the failure.

Please refer to ErrorCodes for the general error handling strategy and details about each possible return value from getErrorCode().

Summary

Public methods

String getDiagnosticInfo()

Retrieve a developer-readable diagnostic information string associated with the exception.

int getErrorCode()

Returns error code associated with this MediaDrmStateException.

int getErrorContext()

Returns MediaDrm plugin vendor defined error context associated with this MediaDrmThrowable.

int getOemError()

Returns OEM or SOC specific error code associated with this MediaDrmThrowable.

int getVendorError()

Returns MediaDrm plugin vendor defined error code associated with this MediaDrmThrowable.

boolean isTransient()

Returns true if the MediaDrmStateException is a transient issue, perhaps due to resource constraints, and that the operation (e.g. provisioning) may succeed on a subsequent attempt.

Inherited methods

Public methods

getDiagnosticInfo

Added in API level 21
public String getDiagnosticInfo ()

Retrieve a developer-readable diagnostic information string associated with the exception. Do not show this to end-users, since this string will not be localized or generally comprehensible to end-users.

Returns
String This value cannot be null.

getErrorCode

Added in API level 31
public int getErrorCode ()

Returns error code associated with this MediaDrmStateException.

Please refer to ErrorCodes for the general error handling strategy and details about each possible return value.

Returns
int an error code defined in MediaDrm.ErrorCodes. Value is MediaDrm.ErrorCodes.ERROR_NO_KEY, MediaDrm.ErrorCodes.ERROR_KEY_EXPIRED, MediaDrm.ErrorCodes.ERROR_RESOURCE_BUSY, MediaDrm.ErrorCodes.ERROR_INSUFFICIENT_OUTPUT_PROTECTION, MediaDrm.ErrorCodes.ERROR_SESSION_NOT_OPENED, MediaDrm.ErrorCodes.ERROR_UNSUPPORTED_OPERATION, MediaDrm.ErrorCodes.ERROR_INSUFFICIENT_SECURITY, MediaDrm.ErrorCodes.ERROR_FRAME_TOO_LARGE, MediaDrm.ErrorCodes.ERROR_LOST_STATE, MediaDrm.ErrorCodes.ERROR_CERTIFICATE_MALFORMED, MediaDrm.ErrorCodes.ERROR_CERTIFICATE_MISSING, MediaDrm.ErrorCodes.ERROR_CRYPTO_LIBRARY, MediaDrm.ErrorCodes.ERROR_GENERIC_OEM, MediaDrm.ErrorCodes.ERROR_GENERIC_PLUGIN, MediaDrm.ErrorCodes.ERROR_INIT_DATA, MediaDrm.ErrorCodes.ERROR_KEY_NOT_LOADED, MediaDrm.ErrorCodes.ERROR_LICENSE_PARSE, MediaDrm.ErrorCodes.ERROR_LICENSE_POLICY, MediaDrm.ErrorCodes.ERROR_LICENSE_RELEASE, MediaDrm.ErrorCodes.ERROR_LICENSE_REQUEST_REJECTED, MediaDrm.ErrorCodes.ERROR_LICENSE_RESTORE, MediaDrm.ErrorCodes.ERROR_LICENSE_STATE, MediaDrm.ErrorCodes.ERROR_MEDIA_FRAMEWORK, MediaDrm.ErrorCodes.ERROR_PROVISIONING_CERTIFICATE, MediaDrm.ErrorCodes.ERROR_PROVISIONING_CONFIG, MediaDrm.ErrorCodes.ERROR_PROVISIONING_PARSE, MediaDrm.ErrorCodes.ERROR_PROVISIONING_REQUEST_REJECTED, MediaDrm.ErrorCodes.ERROR_PROVISIONING_RETRY, MediaDrm.ErrorCodes.ERROR_SECURE_STOP_RELEASE, MediaDrm.ErrorCodes.ERROR_STORAGE_READ, MediaDrm.ErrorCodes.ERROR_STORAGE_WRITE, or MediaDrm.ErrorCodes.ERROR_ZERO_SUBSAMPLES

getErrorContext

Added in API level 34
public int getErrorContext ()

Returns MediaDrm plugin vendor defined error context associated with this MediaDrmThrowable.

Please consult the MediaDrm plugin vendor for details on the error context.

Returns
int an opaque integer that would help the @MediaDrm vendor locate the source of the error if available, otherwise 0.

getOemError

Added in API level 34
public int getOemError ()

Returns OEM or SOC specific error code associated with this MediaDrmThrowable.

Please consult the MediaDrm plugin, chip, or device vendor for details on the error code.

Returns
int an OEM or SOC specific error code if available, otherwise 0.

getVendorError

Added in API level 34
public int getVendorError ()

Returns MediaDrm plugin vendor defined error code associated with this MediaDrmThrowable.

Please consult the MediaDrm plugin vendor for details on the error code.

Returns
int an error code defined by the MediaDrm plugin vendor if available, otherwise 0.

isTransient

Added in API level 31
public boolean isTransient ()

Returns true if the MediaDrmStateException is a transient issue, perhaps due to resource constraints, and that the operation (e.g. provisioning) may succeed on a subsequent attempt.

Returns
boolean