DrmInfoStatuspublic 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_OKIndicate successful communication. | public static final int | STATUS_ERRORIndicate failed communication. | public final int | statusCodeThe status of the communication. Must be one of the defined status
constants above. | public final int | infoTypeThe type of DRM information processed. Must be one of the valid type
constants defined in {@link DrmInfoRequest}. | public final String | mimeTypeThe MIME type of the content. Must not be null or an empty string. | public final ProcessedData | dataThe 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.
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 boolean | isValidStatusCode(int statusCode)
return statusCode == STATUS_OK || statusCode == STATUS_ERROR;
|
|