FileDocCategorySizeDatePackage
DrmInfoEvent.javaAPI DocAndroid 5.1 API3829Thu Mar 12 22:22:30 GMT 2015android.drm

DrmInfoEvent

public class DrmInfoEvent extends DrmEvent
An entity class that is passed to the {@link DrmManagerClient.OnInfoListener#onInfo onInfo()} callback.

Fields Summary
public static final int
TYPE_ALREADY_REGISTERED_BY_ANOTHER_ACCOUNT
The registration has already been done by another account ID.
public static final int
TYPE_REMOVE_RIGHTS
The rights need to be removed completely.
public static final int
TYPE_RIGHTS_INSTALLED
The rights have been successfully downloaded and installed.
public static final int
TYPE_WAIT_FOR_RIGHTS
The rights object is being delivered to the device. You must wait before calling {@link DrmManagerClient#acquireRights acquireRights()} again.
public static final int
TYPE_ACCOUNT_ALREADY_REGISTERED
The registration has already been done for the given account.
public static final int
TYPE_RIGHTS_REMOVED
The rights have been removed.
Constructors Summary
public DrmInfoEvent(int uniqueId, int type, String message)
Creates a DrmInfoEvent 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, or the constants defined in {@link DrmEvent}.
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, to take care vendor specific use
    // cases.

                                                    
           
        super(uniqueId, type, message);
        checkTypeValidity(type);
    
public DrmInfoEvent(int uniqueId, int type, String message, HashMap attributes)
Creates a DrmInfoEvent 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, or the constants defined in {@link DrmEvent}
param
message Message description. It can be null.
param
attributes Attributes for extensible information. Could be any information provided by the plug-in.

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

        if (type < TYPE_ALREADY_REGISTERED_BY_ANOTHER_ACCOUNT ||
            type > TYPE_RIGHTS_REMOVED) {

            if (type != TYPE_ALL_RIGHTS_REMOVED &&
                type != TYPE_DRM_INFO_PROCESSED) {
                final String msg = "Unsupported type: " + type;
                throw new IllegalArgumentException(msg);
            }
        }