Join us on the livestream at Android Dev Summit on 7-8 November 2018, starting at 10AM PDT!
added in API level 26

MediaCas.Session

public final class MediaCas.Session
extends Object implements AutoCloseable

java.lang.Object
   ↳ android.media.MediaCas.Session


Class for an open session with the CA system.

Summary

Public methods

void close()

Close the session.

void processEcm(byte[] data)

Send a received ECM packet to the specified session of the CA system.

void processEcm(byte[] data, int offset, int length)

Send a received ECM packet to the specified session of the CA system.

void setPrivateData(byte[] data)

Set the private data for a session.

Inherited methods

Public methods

close

added in API level 26
public void close ()

Close the session.

Throws
IllegalStateException if the MediaCas instance is not valid.
MediaCasStateException for CAS-specific state exceptions.

processEcm

added in API level 26
public void processEcm (byte[] data)

Send a received ECM packet to the specified session of the CA system. This is similar to processEcm(byte[], int, int) except that the entire byte array is sent.

Parameters
data byte: byte array of the ECM data.

This value must never be null.

Throws
IllegalStateException if the MediaCas instance is not valid.
MediaCasException for CAS-specific errors.
MediaCasStateException for CAS-specific state exceptions.

processEcm

added in API level 26
public void processEcm (byte[] data, 
                int offset, 
                int length)

Send a received ECM packet to the specified session of the CA system.

Parameters
data byte: byte array of the ECM data.

This value must never be null.

offset int: position within data where the ECM data begins.

length int: length of the data (starting from offset).

Throws
IllegalStateException if the MediaCas instance is not valid.
MediaCasException for CAS-specific errors.
MediaCasStateException for CAS-specific state exceptions.

setPrivateData

added in API level 26
public void setPrivateData (byte[] data)

Set the private data for a session.

Parameters
data byte: byte array of the private data.

This value must never be null.

Throws
IllegalStateException if the MediaCas instance is not valid.
MediaCasException for CAS-specific errors.
MediaCasStateException for CAS-specific state exceptions.