Methods Summary |
---|
public void | addFileSuffix(java.lang.String fileSuffix)Adds the specified file suffix to the list of file suffixes this DRM plug-in supports.
if (fileSuffix == "") {
throw new IllegalArgumentException("fileSuffix is an empty string");
}
mFileSuffixList.add(fileSuffix);
|
public void | addMimeType(java.lang.String mimeType)Adds the specified MIME type to the list of MIME types this DRM plug-in supports.
if (mimeType == null) {
throw new IllegalArgumentException("mimeType is null");
}
if (mimeType == "") {
throw new IllegalArgumentException("mimeType is an empty string");
}
mMimeTypeList.add(mimeType);
|
public boolean | equals(java.lang.Object object)Overridden equals implementation. Two DrmSupportInfo objects
are considered being equal if they support exactly the same set of mime
types, file suffixes, and has exactly the same description.
if (object instanceof DrmSupportInfo) {
DrmSupportInfo info = (DrmSupportInfo) object;
return mFileSuffixList.equals(info.mFileSuffixList) &&
mMimeTypeList.equals(info.mMimeTypeList) &&
mDescription.equals(info.mDescription);
}
return false;
|
public java.lang.String | getDescriprition()Retrieves the DRM plug-in (agent) description.
return mDescription;
|
public java.lang.String | getDescription()Retrieves the DRM plug-in (agent) description. Even if null or an empty
string is not allowed in {@link #setDescription(String)}, if
{@link #setDescription(String)} is not called, description returned
from this method is an empty string.
return mDescription;
|
public java.util.Iterator | getFileSuffixIterator()Retrieves an iterator object that you can use to iterate over the file suffixes that
this DRM plug-in supports.
return mFileSuffixList.iterator();
|
public java.util.Iterator | getMimeTypeIterator()Retrieves an iterator object that you can use to iterate over the MIME types that
this DRM plug-in supports.
return mMimeTypeList.iterator();
|
public int | hashCode()Overridden hash code implementation.
return mFileSuffixList.hashCode() + mMimeTypeList.hashCode() + mDescription.hashCode();
|
boolean | isSupportedFileSuffix(java.lang.String fileSuffix)Determines whether a given file suffix is supported.
return mFileSuffixList.contains(fileSuffix);
|
boolean | isSupportedMimeType(java.lang.String mimeType)Determines whether a given MIME type is supported.
if (null != mimeType && !mimeType.equals("")) {
for (int i = 0; i < mMimeTypeList.size(); i++) {
String completeMimeType = mMimeTypeList.get(i);
// The reason that equals() is not used is that sometimes,
// content distributor might just append something to
// the basic MIME type. startsWith() is used to avoid
// frequent update of DRM agent.
if (completeMimeType.startsWith(mimeType)) {
return true;
}
}
}
return false;
|
public void | setDescription(java.lang.String description)Sets a description for the DRM plug-in (agent).
if (description == null) {
throw new IllegalArgumentException("description is null");
}
if (description == "") {
throw new IllegalArgumentException("description is an empty string");
}
mDescription = description;
|