DrmManagerClient
open classDrmManagerClient: AutoCloseable
| kotlin.Any | |
| ↳ | 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.
Summary
| Nested classes | |
|---|---|
| abstract |
Interface definition for a callback that receives information about DRM framework errors. |
| abstract |
Interface definition for a callback that receives information about DRM processing events. |
| abstract |
Interface definition for a callback that receives status messages and warnings during registration and rights acquisition. |
| Constants | |
|---|---|
| static Int |
Indicates that a request was successful or that no error occurred. |
| static Int |
Indicates that an error occurred and the reason is not known. |
| Public constructors | |
|---|---|
DrmManagerClient(context: Context!)Creates a |
|
| Public methods | |
|---|---|
| open DrmInfo! |
acquireDrmInfo(drmInfoRequest: DrmInfoRequest!)Retrieves information for registering, unregistering, or acquiring rights. |
| open Int |
acquireRights(drmInfoRequest: DrmInfoRequest!)Processes a given |
| open Boolean |
Checks whether the given MIME type or URI can be handled. |
| open Boolean |
Checks whether the given MIME type or path can be handled. |
| open Int |
checkRightsStatus(uri: Uri!)Check whether the given content has valid rights. |
| open Int |
checkRightsStatus(uri: Uri!, action: Int)Checks whether the given rights-protected content has valid rights for the specified |
| open Int |
checkRightsStatus(path: String!)Checks whether the given content has valid rights. |
| open Int |
checkRightsStatus(path: String!, action: Int)Checks whether the given rights-protected content has valid rights for the specified |
| open Unit |
close()Releases resources associated with the current session of DrmManagerClient. |
| open DrmConvertedStatus! |
closeConvertSession(convertId: Int)Informs the DRM plug-in (agent) that there is no more data to convert or that an error has occurred. |
| open DrmConvertedStatus! |
convertData(convertId: Int, inputData: ByteArray!)Converts the input data (content) that is part of a rights-protected file. |
| open Array<String!>! |
Retrieves information about all the DRM plug-ins (agents) that are registered with the DRM framework. |
| open MutableCollection<DrmSupportInfo!> |
Retrieves information about all the DRM plug-ins (agents) that are registered with the DRM framework. |
| open ContentValues! |
getConstraints(uri: Uri!, action: Int)Retrieves constraint information for rights-protected content. |
| open ContentValues! |
getConstraints(path: String!, action: Int)Retrieves constraint information for rights-protected content. |
| open Int |
getDrmObjectType(uri: Uri!, mimeType: String!)Retrieves the type of rights-protected object (for example, content object, rights object, and so on) using the specified URI or MIME type. |
| open Int |
getDrmObjectType(path: String!, mimeType: String!)Retrieves the type of rights-protected object (for example, content object, rights object, and so on) using the specified path or MIME type. |
| open ContentValues! |
getMetadata(uri: Uri!)Retrieves metadata information for rights-protected content. |
| open ContentValues! |
getMetadata(path: String!)Retrieves metadata information for rights-protected content. |
| open String! |
getOriginalMimeType(uri: Uri!)Retrieves the MIME type embedded in the original content. |
| open String! |
getOriginalMimeType(path: String!)Retrieves the MIME type embedded in the original content. |
| open Int |
openConvertSession(mimeType: String!)Initiates a new conversion session. |
| open Int |
processDrmInfo(drmInfo: DrmInfo!)Processes the given DRM information based on the information type. |
| open Unit |
release() |
| open Int |
Removes all the rights information of every DRM plug-in (agent) associated with the DRM framework. |
| open Int |
removeRights(uri: Uri!)Removes the rights associated with the given rights-protected content. |
| open Int |
removeRights(path: String!)Removes the rights associated with the given rights-protected content. |
| open Int |
saveRights(drmRights: DrmRights!, rightsPath: String!, contentPath: String!)Saves rights to a specified path and associates that path with the content path. |
| open Unit |
setOnErrorListener(errorListener: DrmManagerClient.OnErrorListener!)Registers an |
| open Unit |
setOnEventListener(eventListener: DrmManagerClient.OnEventListener!)Registers an |
| open Unit |
setOnInfoListener(infoListener: DrmManagerClient.OnInfoListener!)Registers an |
| Protected methods | |
|---|---|
| open Unit |
finalize()Called by the garbage collector on an object when garbage collection determines that there are no more references to the object. |
Constants
ERROR_NONE
static valERROR_NONE: Int
Deprecated: Deprecated in Java.
Indicates that a request was successful or that no error occurred.
Value: 0ERROR_UNKNOWN
static valERROR_UNKNOWN: Int
Deprecated: Deprecated in Java.
Indicates that an error occurred and the reason is not known.
Value: -2000Public constructors
DrmManagerClient
DrmManagerClient(context: Context!)
Creates a DrmManagerClient.
| Parameters | |
|---|---|
context |
Context!: Context of the caller. |
Public methods
acquireDrmInfo
open funacquireDrmInfo(drmInfoRequest: DrmInfoRequest!): DrmInfo!
Deprecated: Deprecated in Java.
Retrieves information for registering, unregistering, or acquiring rights.
| Parameters | |
|---|---|
drmInfoRequest |
DrmInfoRequest!: The DrmInfoRequest that specifies the type of DRM information being retrieved. |
| Return | |
|---|---|
DrmInfo! |
A DrmInfo instance. |
acquireRights
open funacquireRights(drmInfoRequest: DrmInfoRequest!): Int
Deprecated: Deprecated in Java.
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.
| Parameters | |
|---|---|
drmInfoRequest |
DrmInfoRequest!: The DrmInfoRequest used to acquire the rights. |
| Return | |
|---|---|
Int |
ERROR_NONE for success; ERROR_UNKNOWN for failure. |
canHandle
open funcanHandle(
uri: Uri!,
mimeType: String!
): Boolean
Deprecated: Deprecated in Java.
Checks whether the given MIME type or URI can be handled.
| Parameters | |
|---|---|
uri |
Uri!: URI for the content to be handled. |
mimeType |
String!: MIME type of the object to be handled |
| Return | |
|---|---|
Boolean |
True if the given MIME type or URI can be handled; false if they cannot be handled. |
canHandle
open funcanHandle(
path: String!,
mimeType: String!
): Boolean
Deprecated: Deprecated in Java.
Checks whether the given MIME type or path can be handled.
| Parameters | |
|---|---|
path |
String!: Path of the content to be handled. |
mimeType |
String!: MIME type of the object to be handled. |
| Return | |
|---|---|
Boolean |
True if the given MIME type or path can be handled; false if they cannot be handled. |
checkRightsStatus
open funcheckRightsStatus(uri: Uri!): Int
Deprecated: Deprecated in Java.
Check whether the given content has valid rights.
| Parameters | |
|---|---|
uri |
Uri!: URI of the rights-protected content. |
| Return | |
|---|---|
Int |
An int representing the DrmStore.RightsStatus of the content. |
checkRightsStatus
open funcheckRightsStatus(
uri: Uri!,
action: Int
): Int
Deprecated: Deprecated in Java.
Checks whether the given rights-protected content has valid rights for the specified DrmStore.Action.
| Parameters | |
|---|---|
uri |
Uri!: URI for the rights-protected content. |
action |
Int: The DrmStore.Action to perform. |
| Return | |
|---|---|
Int |
An int representing the DrmStore.RightsStatus of the content. |
checkRightsStatus
open funcheckRightsStatus(path: String!): Int
Deprecated: Deprecated in Java.
Checks whether the given content has valid rights.
| Parameters | |
|---|---|
path |
String!: Path to the rights-protected content. |
| Return | |
|---|---|
Int |
An int representing the DrmStore.RightsStatus of the content. |
checkRightsStatus
open funcheckRightsStatus(
path: String!,
action: Int
): Int
Deprecated: Deprecated in Java.
Checks whether the given rights-protected content has valid rights for the specified DrmStore.Action.
| Parameters | |
|---|---|
path |
String!: Path to the rights-protected content. |
action |
Int: The DrmStore.Action to perform. |
| Return | |
|---|---|
Int |
An int representing the DrmStore.RightsStatus of the content. |
close
open funclose(): Unit
Deprecated: Deprecated in Java.
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 n