FileDocCategorySizeDatePackage
DrmErrorEvent.javaAPI DocAndroid 5.1 API3931Thu Mar 12 22:22:30 GMT 2015android.drm

DrmErrorEvent

public class DrmErrorEvent extends DrmEvent
An entity class that is passed to the {@link DrmManagerClient.OnErrorListener#onError onError()} callback.

Fields Summary
public static final int
TYPE_RIGHTS_NOT_INSTALLED
Something went wrong installing the rights.
public static final int
TYPE_RIGHTS_RENEWAL_NOT_ALLOWED
The server rejected the renewal of rights.
public static final int
TYPE_NOT_SUPPORTED
Response from the server cannot be handled by the DRM plug-in (agent).
public static final int
TYPE_OUT_OF_MEMORY
Memory allocation failed during renewal. Can in the future perhaps be used to trigger garbage collector.
public static final int
TYPE_NO_INTERNET_CONNECTION
An Internet connection is not available and no attempt can be made to renew rights.
public static final int
TYPE_PROCESS_DRM_INFO_FAILED
Failed to process {@link DrmInfo}. This error event is sent when a {@link DrmManagerClient#processDrmInfo processDrmInfo()} call fails.
public static final int
TYPE_REMOVE_ALL_RIGHTS_FAILED
Failed to remove all the rights objects associated with all DRM schemes.
public static final int
TYPE_ACQUIRE_DRM_INFO_FAILED
Failed to acquire {@link DrmInfo}. This error event is sent when an {@link DrmManagerClient#acquireDrmInfo acquireDrmInfo()} call fails.
Constructors Summary
public DrmErrorEvent(int uniqueId, int type, String message)
Creates a DrmErrorEvent object with the specified parameters.

param
uniqueId Unique session identifier.
param
type Type of the event. Must be any of the event types defined above.
param
message Message description. It can be null.


    // Add more type constants here...

    // FIXME:
    // We may want to add a user-defined type constant, such as
    // TYPE_VENDOR_SPECIFIC_FAILED, to take care vendor specific use
    // cases.


                                             
           
        super(uniqueId, type, message);
        checkTypeValidity(type);
    
public DrmErrorEvent(int uniqueId, int type, String message, HashMap attributes)
Creates a DrmErrorEvent object with the specified parameters.

param
uniqueId Unique session identifier.
param
type Type of the event. Must be any of the event types defined above.
param
message Message description.
param
attributes Attributes for extensible information. Could be any information provided by the plug-in. It can be null.

        super(uniqueId, type, message, attributes);
        checkTypeValidity(type);
    
Methods Summary
private voidcheckTypeValidity(int type)

        if (type < TYPE_RIGHTS_NOT_INSTALLED ||
            type > TYPE_ACQUIRE_DRM_INFO_FAILED) {
            final String msg = "Unsupported type: " + type;
            throw new IllegalArgumentException(msg);
        }