FileDocCategorySizeDatePackage
DrmInfoStatus.javaAPI DocAndroid 5.1 API3490Thu Mar 12 22:22:30 GMT 2015android.drm

DrmInfoStatus

public class DrmInfoStatus extends Object
An entity class that wraps the result of communication between a device and an online DRM server. Specifically, when the {@link DrmManagerClient#processDrmInfo DrmManagerClient.processDrmInfo()} method is called, an instance of DrmInfoStatus is returned.

This class contains the {@link ProcessedData} object, which can be used to instantiate a {@link DrmRights} object during license acquisition.

Fields Summary
public static final int
STATUS_OK
Indicate successful communication.
public static final int
STATUS_ERROR
Indicate failed communication.
public final int
statusCode
The status of the communication. Must be one of the defined status constants above.
public final int
infoType
The type of DRM information processed. Must be one of the valid type constants defined in {@link DrmInfoRequest}.
public final String
mimeType
The MIME type of the content. Must not be null or an empty string.
public final ProcessedData
data
The processed data. It is optional and thus could be null. When it is null, it indicates that a particular call to {@link DrmManagerClient#processDrmInfo DrmManagerClient.processDrmInfo()} does not return any additional useful information except for the status code.
Constructors Summary
public DrmInfoStatus(int statusCode, int infoType, ProcessedData data, String mimeType)
Creates a DrmInfoStatus object with the specified parameters.

param
statusCode The status of the communication. Must be one of the defined status constants above.
param
infoType The type of the DRM information processed. Must be a valid type for {@link DrmInfoRequest}.
param
data The processed data.
param
mimeType The MIME type.


                                                            
             
        if (!DrmInfoRequest.isValidType(infoType)) {
            throw new IllegalArgumentException("infoType: " + infoType);
        }

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

        if (mimeType == null || mimeType == "") {
            throw new IllegalArgumentException("mimeType is null or an empty string");
        }

        this.statusCode = statusCode;
        this.infoType = infoType;
        this.data = data;
        this.mimeType = mimeType;
    
Methods Summary
private booleanisValidStatusCode(int statusCode)

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