java.lang.Object | |
↳ | android.drm.DrmManagerClient |
The main programming interface for the DRM framework. An application must instantiate this class to access DRM agents through the DRM framework.
Nested Classes | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
DrmManagerClient.OnErrorListener | Interface definition for a callback that receives information about DRM framework errors. | ||||||||||
DrmManagerClient.OnEventListener | Interface definition for a callback that receives information about DRM processing events. | ||||||||||
DrmManagerClient.OnInfoListener | Interface definition for a callback that receives status messages and warnings during registration and rights acquisition. |
Constants | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
int | ERROR_NONE | Indicates that a request was successful or that no error occurred. | |||||||||
int | ERROR_UNKNOWN | Indicates that an error occurred and the reason is not known. |
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Creates a
DrmManagerClient .
|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Retrieves information for registering, unregistering, or acquiring rights.
| |||||||||||
Processes a given
DrmInfoRequest and returns the rights information asynchronously.
| |||||||||||
Checks whether the given MIME type or URI can be handled.
| |||||||||||
Checks whether the given MIME type or path can be handled.
| |||||||||||
Checks whether the given content has valid rights.
| |||||||||||
Checks whether the given rights-protected content has valid rights for the specified
DrmStore.Action .
| |||||||||||
Checks whether the given rights-protected content has valid rights for the specified
DrmStore.Action .
| |||||||||||
Check whether the given content has valid rights.
| |||||||||||
Informs the DRM plug-in (agent) that there is no more data to convert or that an error
has occurred.
| |||||||||||
Converts the input data (content) that is part of a rights-protected file.
| |||||||||||
Retrieves information about all the DRM plug-ins (agents) that are registered with
the DRM framework.
| |||||||||||
Retrieves constraint information for rights-protected content.
| |||||||||||
Retrieves constraint information for rights-protected content.
| |||||||||||
Retrieves the type of rights-protected object (for example, content object, rights
object, and so on) using the specified URI or MIME type.
| |||||||||||
Retrieves the type of rights-protected object (for example, content object, rights
object, and so on) using the specified path or MIME type.
| |||||||||||
Retrieves metadata information for rights-protected content.
| |||||||||||
Retrieves metadata information for rights-protected content.
| |||||||||||
Retrieves the MIME type embedded in the original content.
| |||||||||||
Retrieves the MIME type embedded in the original content.
| |||||||||||
Initiates a new conversion session.
| |||||||||||
Processes the given DRM information based on the information type.
| |||||||||||
Releases resources associated with the current session of DrmManagerClient.
| |||||||||||
Removes all the rights information of every DRM plug-in (agent) associated with
the DRM framework.
| |||||||||||
Removes the rights associated with the given rights-protected content.
| |||||||||||
Removes the rights associated with the given rights-protected content.
| |||||||||||
Saves rights to a specified path and associates that path with the content path.
| |||||||||||
Registers an
DrmManagerClient.OnErrorListener callback, which is invoked when
the DRM framework sends error information.
| |||||||||||
Registers an
DrmManagerClient.OnEventListener callback, which is invoked when the
DRM framework sends information about DRM processing.
| |||||||||||
Registers an
DrmManagerClient.OnInfoListener callback, which is invoked when the
DRM framework sends status or warning information during registration or rights acquisition.
|
Protected Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Invoked when the garbage collector has detected that this instance is no longer reachable.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
|
Indicates that a request was successful or that no error occurred.
Indicates that an error occurred and the reason is not known.
Creates a DrmManagerClient
.
context | Context of the caller. |
---|
Retrieves information for registering, unregistering, or acquiring rights.
drmInfoRequest | The DrmInfoRequest that specifies the type of DRM
information being retrieved. |
---|
DrmInfo
instance.
Processes a given DrmInfoRequest
and returns the rights information asynchronously.
This is a utility method that consists of an
acquireDrmInfo()
and a
processDrmInfo()
method call. This utility method can be
used only if the selected DRM plug-in (agent) supports this sequence of calls. Some DRM
agents, such as OMA, do not support this utility method, in which case an application must
invoke acquireDrmInfo()
and
processDrmInfo()
separately.
drmInfoRequest | The DrmInfoRequest used to acquire the rights. |
---|
Checks whether the given MIME type or URI can be handled.
uri | URI for the content to be handled. |
---|---|
mimeType | MIME type of the object to be handled |
Checks whether the given MIME type or path can be handled.
path | Path of the content to be handled. |
---|---|
mimeType | MIME type of the object to be handled. |
Checks whether the given content has valid rights.
path | Path to the rights-protected content. |
---|
int
representing the DrmStore.RightsStatus
of the content.
Checks whether the given rights-protected content has valid rights for the specified
DrmStore.Action
.
path | Path to the rights-protected content. |
---|---|
action | The DrmStore.Action to perform. |
int
representing the DrmStore.RightsStatus
of the content.
Checks whether the given rights-protected content has valid rights for the specified
DrmStore.Action
.
uri | URI for the rights-protected content. |
---|---|
action | The DrmStore.Action to perform. |
int
representing the DrmStore.RightsStatus
of the content.
Check whether the given content has valid rights.
uri | URI of the rights-protected content. |
---|
int
representing the DrmStore.RightsStatus
of the content.
Informs the DRM plug-in (agent) that there is no more data to convert or that an error has occurred. Upon successful conversion of the data, the DRM agent will provide an offset value indicating where the header and body signature should be added. Appending the signature is necessary to protect the integrity of the converted file.
convertId | Handle for the conversion session. |
---|
DrmConvertedStatus
object that contains the status of the data conversion,
the converted data, and the offset for the header and body signature.
Converts the input data (content) that is part of a rights-protected file. The converted
data and status is returned in a DrmConvertedStatus
object. This method should be
called each time there is a new block of data received by the application.
convertId | Handle for the conversion session. |
---|---|
inputData | Input data that needs to be converted. |
DrmConvertedStatus
object that contains the status of the data conversion,
the converted data, and offset for the header and body signature. An application can
ignore the offset because it is only relevant to the
closeConvertSession()
method.
Retrieves information about all the DRM plug-ins (agents) that are registered with the DRM framework.
String
array of DRM plug-in descriptions.
Retrieves constraint information for rights-protected content.
path | Path to the content from which you are retrieving DRM constraints. |
---|---|
action | Action defined in DrmStore.Action . |
ContentValues
instance that contains
key-value pairs representing the constraints. Null in case of failure.
The keys are defined in DrmStore.ConstraintsColumns
.
Retrieves constraint information for rights-protected content.
uri | URI for the content from which you are retrieving DRM constraints. |
---|---|
action | Action defined in DrmStore.Action . |
ContentValues
instance that contains
key-value pairs representing the constraints. Null in case of failure.
Retrieves the type of rights-protected object (for example, content object, rights object, and so on) using the specified URI or MIME type. At least one parameter must be specified to retrieve the DRM object type.
uri | URI for the content or null. |
---|---|
mimeType | MIME type of the content or null. |
int
that corresponds to a DrmStore.DrmObjectType
.
Retrieves the type of rights-protected object (for example, content object, rights object, and so on) using the specified path or MIME type. At least one parameter must be specified to retrieve the DRM object type.
path | Path to the content or null. |
---|---|
mimeType | MIME type of the content or null. |
int
that corresponds to a DrmStore.DrmObjectType
.
Retrieves metadata information for rights-protected content.
uri | URI for the content from which you are retrieving metadata information. |
---|
ContentValues
instance that contains
key-value pairs representing the constraints. Null in case of failure.
Retrieves metadata information for rights-protected content.
path | Path to the content from which you are retrieving metadata information. |
---|
ContentValues
instance that contains
key-value pairs representing the metadata. Null in case of failure.
Retrieves the MIME type embedded in the original content.
path | Path to the rights-protected content. |
---|
video/mpeg
.
Retrieves the MIME type embedded in the original content.
uri | URI of the rights-protected content. |
---|
video/mpeg
.
Initiates a new conversion session. An application must initiate a conversion session with this method each time it downloads a rights-protected file that needs to be converted.
This method applies only to forward-locking (copy protection) DRM schemes.
mimeType | MIME type of the input data packet. |
---|
Processes the given DRM information based on the information type.
drmInfo | The DrmInfo to be processed. |
---|
Releases resources associated with the current session of DrmManagerClient.
It is considered good practice to call this method when the DrmManagerClient
object
is no longer needed in your application. After release() is called,
DrmManagerClient
is no longer usable since it has lost all of its required resource.
Removes all the rights information of every DRM plug-in (agent) associated with the DRM framework. Will be used during a master reset.
Removes the rights associated with the given rights-protected content.
path | Path to the rights-protected content. |
---|
Removes the rights associated with the given rights-protected content.
uri | URI for the rights-protected content. |
---|
Saves rights to a specified path and associates that path with the content path.
Note: For OMA or WM-DRM, rightsPath
and
contentPath
can be null.
drmRights | The DrmRights to be saved. |
---|---|
rightsPath | File path where rights will be saved. |
contentPath | File path where content is saved. |
IOException | If the call failed to save rights information at the given
rightsPath .
|
---|
Registers an DrmManagerClient.OnErrorListener
callback, which is invoked when
the DRM framework sends error information.
errorListener | Interface definition for the callback. |
---|
Registers an DrmManagerClient.OnEventListener
callback, which is invoked when the
DRM framework sends information about DRM processing.
eventListener | Interface definition for the callback. |
---|
Registers an DrmManagerClient.OnInfoListener
callback, which is invoked when the
DRM framework sends status or warning information during registration or rights acquisition.
infoListener | Interface definition for the callback. |
---|
Invoked when the garbage collector has detected that this instance is no longer reachable. The default implementation does nothing, but this method can be overridden to free resources.
Note that objects that override finalize
are significantly more expensive than
objects that don't. Finalizers may be run a long time after the object is no longer
reachable, depending on memory pressure, so it's a bad idea to rely on them for cleanup.
Note also that finalizers are run on a single VM-wide finalizer thread,
so doing blocking work in a finalizer is a bad idea. A finalizer is usually only necessary
for a class that has a native peer and needs to call a native method to destroy that peer.
Even then, it's better to provide an explicit close
method (and implement
Closeable
), and insist that callers manually dispose of instances. This
works well for something like files, but less well for something like a BigInteger
where typical calling code would have to deal with lots of temporaries. Unfortunately,
code that creates lots of temporaries is the worst kind of code from the point of view of
the single finalizer thread.
If you must use finalizers, consider at least providing your own
ReferenceQueue
and having your own thread process that queue.
Unlike constructors, finalizers are not automatically chained. You are responsible for
calling super.finalize()
yourself.
Uncaught exceptions thrown by finalizers are ignored and do not terminate the finalizer thread. See Effective Java Item 7, "Avoid finalizers" for more.
Throwable |
---|