summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xdrm/java/android/drm/DrmInfo.java14
-rwxr-xr-xdrm/java/android/drm/DrmInfoRequest.java5
-rwxr-xr-xdrm/java/android/drm/DrmInfoStatus.java4
-rwxr-xr-xdrm/java/android/drm/DrmRights.java21
4 files changed, 40 insertions, 4 deletions
diff --git a/drm/java/android/drm/DrmInfo.java b/drm/java/android/drm/DrmInfo.java
index 8812bfe..22d06c7 100755
--- a/drm/java/android/drm/DrmInfo.java
+++ b/drm/java/android/drm/DrmInfo.java
@@ -49,6 +49,13 @@ public class DrmInfo {
mInfoType = infoType;
mMimeType = mimeType;
mData = data;
+ if (!isValid()) {
+ final String msg = "infoType: " + infoType + "," +
+ "mimeType: " + mimeType + "," +
+ "data: " + data;
+
+ throw new IllegalArgumentException(msg);
+ }
}
/**
@@ -69,6 +76,13 @@ public class DrmInfo {
// call would fail with IllegalArgumentException because of mData = null
mData = null;
}
+ if (!isValid()) {
+ final String msg = "infoType: " + infoType + "," +
+ "mimeType: " + mimeType + "," +
+ "data: " + mData;
+
+ throw new IllegalArgumentException();
+ }
}
/**
diff --git a/drm/java/android/drm/DrmInfoRequest.java b/drm/java/android/drm/DrmInfoRequest.java
index 1429fa5..621da41 100755
--- a/drm/java/android/drm/DrmInfoRequest.java
+++ b/drm/java/android/drm/DrmInfoRequest.java
@@ -67,6 +67,11 @@ public class DrmInfoRequest {
public DrmInfoRequest(int infoType, String mimeType) {
mInfoType = infoType;
mMimeType = mimeType;
+ if (!isValid()) {
+ final String msg = "infoType: " + infoType + "," +
+ "mimeType: " + mimeType;
+ throw new IllegalArgumentException(msg);
+ }
}
/**
diff --git a/drm/java/android/drm/DrmInfoStatus.java b/drm/java/android/drm/DrmInfoStatus.java
index 5c12ae3..2fe0a78 100755
--- a/drm/java/android/drm/DrmInfoStatus.java
+++ b/drm/java/android/drm/DrmInfoStatus.java
@@ -56,6 +56,10 @@ public class DrmInfoStatus {
* @param _mimeType The MIME type.
*/
public DrmInfoStatus(int _statusCode, int _infoType, ProcessedData _data, String _mimeType) {
+ if (!DrmInfoRequest.isValidType(_infoType)) {
+ throw new IllegalArgumentException("infoType: " + _infoType);
+ }
+
statusCode = _statusCode;
infoType = _infoType;
data = _data;
diff --git a/drm/java/android/drm/DrmRights.java b/drm/java/android/drm/DrmRights.java
index ef9c21d..d4afed1 100755
--- a/drm/java/android/drm/DrmRights.java
+++ b/drm/java/android/drm/DrmRights.java
@@ -103,6 +103,11 @@ public class DrmRights {
}
mMimeType = mimeType;
+ if (!isValid()) {
+ final String msg = "mimeType: " + mMimeType + "," +
+ "data: " + mData;
+ throw new IllegalArgumentException(msg);
+ }
}
/**
@@ -117,17 +122,25 @@ public class DrmRights {
mData = data.getData();
String accountId = data.getAccountId();
- if (null != accountId && !accountId.equals("")) {
- mAccountId = accountId;
+ if (null == accountId || !accountId.equals("")) {
+ throw new IllegalArgumentException("accountId: " + accountId);
}
+ mAccountId = accountId;
String subscriptionId = data.getSubscriptionId();
- if (null != subscriptionId && !subscriptionId.equals("")) {
- mSubscriptionId = subscriptionId;
+ if (null == subscriptionId || !subscriptionId.equals("")) {
+ throw new IllegalArgumentException(
+ "subscriptionId: " + subscriptionId);
}
+ mSubscriptionId = subscriptionId;
}
mMimeType = mimeType;
+ if (!isValid()) {
+ final String msg = "mimeType: " + mMimeType + "," +
+ "data: " + mData;
+ throw new IllegalArgumentException(msg);
+ }
}
/**