FileDocCategorySizeDatePackage
DrmConvertedStatus.javaAPI DocAndroid 5.1 API3071Thu Mar 12 22:22:30 GMT 2015android.drm

DrmConvertedStatus

public class DrmConvertedStatus extends Object
An entity class that wraps converted data, conversion status, and the offset for appending the header and body signature to the converted data. An instance of this class may be created two ways by the drm framework: a) a call to {@link DrmManagerClient#convertData DrmManagerClient.convertData()} and b) a call to {@link DrmManagerClient#closeConvertSession DrmManagerClient.closeConvertSession()}. An valid offset value is provided only from a success call to {@link DrmManagerClient#closeConvertSession DrmManagerClient.closeConvertSession()}.

Fields Summary
public static final int
STATUS_OK
Indicate the conversion status is successful.
public static final int
STATUS_INPUTDATA_ERROR
Indicate a failed conversion status due to input data.
public static final int
STATUS_ERROR
Indicate a general failed conversion status.
public final int
statusCode
Status code for the conversion. Must be one of the defined status constants above.
public final byte[]
convertedData
Converted data. It is optional and thus can be null.
public final int
offset
Offset value for the body and header signature.
Constructors Summary
public DrmConvertedStatus(int statusCode, byte[] convertedData, int offset)
Creates a DrmConvertedStatus object with the specified parameters.

param
statusCode Conversion status. Must be one of the status code constants defined above.
param
convertedData Converted data. It can be null.
param
offset Offset value for appending the header and body signature.


                                                  
           
        if (!isValidStatusCode(statusCode)) {
            throw new IllegalArgumentException("Unsupported status code: " + statusCode);
        }

        this.statusCode = statusCode;
        this.convertedData = convertedData;
        this.offset = offset;
    
Methods Summary
private booleanisValidStatusCode(int statusCode)

        return statusCode == STATUS_OK ||
               statusCode == STATUS_INPUTDATA_ERROR ||
               statusCode == STATUS_ERROR;