public static final class MediaDrm.KeyRequest
extends Object



Contains the opaque data an app uses to request keys from a license server. These request types may or may not be generated by a given plugin. Refer to plugin vendor documentation for more information.

Summary

Constants

int REQUEST_TYPE_INITIAL

Key request type is initial license request.

int REQUEST_TYPE_NONE

Keys are already loaded and are available for use.

int REQUEST_TYPE_RELEASE

Key request type is license release

int REQUEST_TYPE_RENEWAL

Key request type is license renewal.

int REQUEST_TYPE_UPDATE

Keys have been loaded but an additional license request is needed to update their values.

Public methods

byte[] getData()

Get the opaque message data

String getDefaultUrl()

Get the default URL to use when sending the key request message to a server, if known.

int getRequestType()

Get the type of the request

Inherited methods

From class java.lang.Object

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

REQUEST_TYPE_INITIAL

public static final int REQUEST_TYPE_INITIAL

Key request type is initial license request. A license request is necessary to load keys.

Constant Value: 0 (0x00000000)

REQUEST_TYPE_NONE

public static final int REQUEST_TYPE_NONE

Keys are already loaded and are available for use. No license request is necessary, and no key request data is returned.

Constant Value: 3 (0x00000003)

REQUEST_TYPE_RELEASE

public static final int REQUEST_TYPE_RELEASE

Key request type is license release

Constant Value: 2 (0x00000002)

REQUEST_TYPE_RENEWAL

public static final int REQUEST_TYPE_RENEWAL

Key request type is license renewal. A license request is necessary to prevent the keys from expiring.

Constant Value: 1 (0x00000001)

REQUEST_TYPE_UPDATE

public static final int REQUEST_TYPE_UPDATE

Keys have been loaded but an additional license request is needed to update their values.

Constant Value: 4 (0x00000004)

Public methods

getData

public byte[] getData ()

Get the opaque message data

Returns
byte[] This value cannot be null.

getDefaultUrl

public String getDefaultUrl ()

Get the default URL to use when sending the key request message to a server, if known. The app may prefer to use a different license server URL from other sources. This method returns an empty string if the default URL is not known.

Returns
String This value cannot be null.

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 2026-02-13 UTC.