MediaDrm.KeyStatus


public static final class MediaDrm.KeyStatus
extends Object

java.lang.Object
   ↳ android.media.MediaDrm.KeyStatus


Defines the status of a key. A KeyStatus for each key in a session is provided to the OnKeyStatusChangeListener.onKeyStatusChange listener.

Summary

Constants

int STATUS_EXPIRED

The key is no longer usable to decrypt media data because its expiration time has passed.

int STATUS_INTERNAL_ERROR

The key is not currently usable to decrypt media data because of an internal error in processing unrelated to input parameters.

int STATUS_OUTPUT_NOT_ALLOWED

The key is not currently usable to decrypt media data because its output requirements cannot currently be met.

int STATUS_PENDING

The status of the key is not yet known and is being determined.

int STATUS_USABLE

The key is currently usable to decrypt media data

int STATUS_USABLE_IN_FUTURE

The key is not yet usable to decrypt media because the start time is in the future.

Public methods

byte[] getKeyId()

Returns the id for the key

int getStatusCode()

Returns the status code for the key

Inherited methods

Object clone()

Creates and returns a copy of this object.

boolean equals(Object obj)

Indicates whether some other object is "equal to" this one.

void finalize()

Called by the garbage collector on an object when garbage collection determines that there are no more references to the object.

final Class<?> getClass()

Returns the runtime class of this Object.

int hashCode()

Returns a hash code value for the object.

final void notify()

Wakes up a single thread that is waiting on this object's monitor.

final void notifyAll()

Wakes up all threads that are waiting on this object's monitor.

String toString()

Returns a string representation of the object.

final void wait(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(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()

Causes the current thread to wait until it is awakened, typically by being notified or interrupted.

Constants

STATUS_EXPIRED

Added in API level 23
public static final int STATUS_EXPIRED

The key is no longer usable to decrypt media data because its expiration time has passed.

Constant Value: 1 (0x00000001)

STATUS_INTERNAL_ERROR

Added in API level 23
public static final int STATUS_INTERNAL_ERROR

The key is not currently usable to decrypt media data because of an internal error in processing unrelated to input parameters. This error is not actionable by an app.

Constant Value: 4 (0x00000004)

STATUS_OUTPUT_NOT_ALLOWED

Added in API level 23
public static final int STATUS_OUTPUT_NOT_ALLOWED

The key is not currently usable to decrypt media data because its output requirements cannot currently be met.

Constant Value: 2 (0x00000002)

STATUS_PENDING

Added in API level 23
public static final int STATUS_PENDING

The status of the key is not yet known and is being determined. The status will be updated with the actual status when it has been determined.

Constant Value: 3 (0x00000003)

STATUS_USABLE

Added in API level 23
public static final int STATUS_USABLE

The key is currently usable to decrypt media data

Constant Value: 0 (0x00000000)

STATUS_USABLE_IN_FUTURE

Added in API level 29
public static final int STATUS_USABLE_IN_FUTURE

The key is not yet usable to decrypt media because the start time is in the future. The key will become usable when its start time is reached.

Constant Value: 5 (0x00000005)

Public methods

getKeyId

Added in API level 23
public byte[] getKeyId ()

Returns the id for the key

Returns
byte[] This value cannot be null.

getStatusCode

Added in API level 23
public int getStatusCode ()

Returns the status code for the key