Package: android.hardware.drm@1.0

types

Properties

SessionId

typedef vec SessionId

KeyedVector

typedef vec KeyedVector

SecureStopId

typedef vec SecureStopId

Status

enum Status: uint32_t
Details
Members
OK
The DRM plugin must return OK when an operation completes without any errors.
ERROR_DRM_NO_LICENSE
The DRM plugin must return ERROR_DRM_NO_LICENSE, when decryption is attempted and no license keys have been provided.
ERROR_DRM_LICENSE_EXPIRED
ERROR_DRM_LICENSE_EXPIRED must be returned when an attempt is made to use a license and the keys in that license have expired.
ERROR_DRM_SESSION_NOT_OPENED
The DRM plugin must return ERROR_DRM_SESSION_NOT_OPENED when an attempt is made to use a session that has not been opened.
ERROR_DRM_CANNOT_HANDLE
The DRM plugin must return ERROR_DRM_CANNOT_HANDLE when an unsupported data format or operation is attempted.
ERROR_DRM_INVALID_STATE
ERROR_DRM_INVALID_STATE must be returned when the device is in a state where it is not able to perform decryption.
BAD_VALUE
The DRM plugin must return BAD_VALUE whenever an illegal parameter is passed to one of the interface functions.
ERROR_DRM_NOT_PROVISIONED
The DRM plugin must return ERROR_DRM_NOT_PROVISIONED from getKeyRequest, openSession or provideKeyResponse when the device has not yet been provisioned.
ERROR_DRM_RESOURCE_BUSY
ERROR_DRM_RESOURCE_BUSY must be returned when resources, such as drm sessions or secure buffers are not available to perform a requested operation because they are already in use.
ERROR_DRM_INSUFFICIENT_OUTPUT_PROTECTION
The DRM Plugin must return ERROR_DRM_INSUFFICIENT_OUTPUT_PROTECTION when the output protection level enabled on the device is not sufficient to meet the requirements in the license policy.HDCP is an example of a form of output protection.
ERROR_DRM_DEVICE_REVOKED
The DRM Plugin must return ERROR_DRM_DEVICE_REVOKED from provideProvisionResponse and provideKeyResponse if the response indicates that the device has been revoked.Device revocation means that the device is no longer permitted to play content.
ERROR_DRM_DECRYPT
The DRM Plugin must return ERROR_DRM_DECRYPT if the CryptoPlugin decrypt operation fails.
ERROR_DRM_UNKNOWN
ERROR_DRM_UNKNOWN must be returned when a fatal failure occurs and no other defined error is appropriate.

EventType

enum EventType: uint32_t

EventType enumerates the events that can be delivered by sendEvent

Details
Members
PROVISION_REQUIRED
This event type indicates that the app needs to request a certificate from the provisioning server.The request message data is obtained using getProvisionRequest().
KEY_NEEDED
This event type indicates that the app needs to request keys from a license server.The request message data is obtained using getKeyRequest.
KEY_EXPIRED
This event type indicates that the licensed usage duration for keys in a session has expired.The keys are no longer valid.
VENDOR_DEFINED
This event may indicate some specific vendor-defined condition, see your DRM provider documentation for details.
SESSION_RECLAIMED
This event indicates that a session opened by the app has been reclaimed by the resource manager.

KeyType

enum KeyType: uint32_t
Details
Members
OFFLINE
Drm keys can be for offline content or for online streaming.Offline keys are persisted on the device and may be used when the device is disconnected from the network.
STREAMING
Keys for streaming are not persisted and require the device to be connected to the network for periodic renewal.
RELEASE
The Release type is used to request that offline keys be no longer restricted to offline use.

KeyRequestType

enum KeyRequestType: uint32_t

Enumerate KeyRequestTypes to allow an app to determine the type of a key request returned from getKeyRequest.

Details
Members
INITIAL
Key request type is for an initial license request
RENEWAL
Key request type is for license renewal.Renewal requests are used to extend the validity period for streaming keys.
RELEASE
Key request type is a release.A key release causes offline keys to become available for streaming.
UNKNOWN
Key request type is unknown due to some error condition.

KeyStatusType

enum KeyStatusType: uint32_t

Enumerate KeyStatusTypes which indicate the state of a key

Details
Members
USABLE
The key is currently usable to decrypt media data.
EXPIRED
The key is no longer usable to decrypt media data because its expiration time has passed.
OUTPUTNOTALLOWED
The key is not currently usable to decrypt media data because its output requirements cannot currently be met.
STATUSPENDING
The status of the key is not yet known and is being determined.
INTERNALERROR
The key is not currently usable to decrypt media data because of an internal error in processing unrelated to input parameters.

Mode

enum Mode: uint32_t

Enumerate the supported crypto modes

Details
Members
UNENCRYPTED = 0
AES_CTR = 1
AES_CBC_CTS = 2
AES_CBC = 3

BufferType

enum BufferType: uint32_t
Details
Members
SHARED_MEMORY = 0
NATIVE_HANDLE = 1

KeyStatus

struct KeyStatus {vec keyId; KeyStatusType type}

Used by sendKeysChange to report the usability status of each key to the app.

Details
Members
keyId
type

KeyValue

struct KeyValue {string key; string value}

Simulates a KeyedVector<String8, String8 >

Details
Members
key
value

SecureStop

struct SecureStop {vec opaqueData}

Encapsulates a secure stop opaque object

Details
Members
opaqueData

SubSample

struct SubSample {uint32_t numBytesOfClearData; uint32_t numBytesOfEncryptedData}

A subsample consists of some number of bytes of clear(unencrypted)data followed by a number of bytes of encrypted data.

Details
Members
numBytesOfClearData
numBytesOfEncryptedData

Pattern

struct Pattern {uint32_t encryptBlocks; uint32_t skipBlocks}

A crypto Pattern is a repeating sequence of encrypted and clear blocks occuring within the bytes indicated by mNumBytesOfEncryptedDatad bytes of a subsample.Patterns are used to reduce the CPU overhead of decrypting samples.As an example, HLS uses 1:9 patterns where every 10th block is encrypted.

Details
Members
encryptBlocks
The number of blocks to be encrypted in the pattern.If zero, pattern encryption is inoperative.
skipBlocks
The number of blocks to be skipped(left clear)in the pattern.If zero, pattern encryption is inoperative.

SharedBuffer

struct SharedBuffer {uint32_t bufferId; uint64_t offset; uint64_t size}

SharedBuffer describes a decrypt buffer which is defined by a bufferId, an offset and a size.The offset is relative to the shared memory base for the memory region identified by bufferId, which is established by setSharedMemoryBase().

Details
Members
bufferId
The unique buffer identifier
offset
The offset from the shared memory base
size
The size of the shared buffer in bytes

DestinationBuffer

struct DestinationBuffer {BufferType type; SharedBuffer nonsecureMemory; handle secureMemory}

A decrypt destination buffer can be either normal user-space shared memory for the non-secure decrypt case, or it can be a secure buffer which is referenced by a native-handle.The native handle is allocated by the vendor's buffer allocator.

Details
Members
type
The type of the buffer
nonsecureMemory
If type == SHARED_MEMORY, the decrypted data must be written to user-space non-secure shared memory.
secureMemory
If type == NATIVE_HANDLE, the decrypted data must be written to secure memory referenced by the vendor's buffer allocator.