diff options
author | Gloria Wang <gwang@google.com> | 2011-06-22 14:55:16 -0700 |
---|---|---|
committer | Gloria Wang <gwang@google.com> | 2011-06-22 16:36:24 -0700 |
commit | b7e7bdfe784959ac8615851c2741eb9518a5afcf (patch) | |
tree | 4111a7f161fc225c4396a62192828168bfa3833c /drm/java | |
parent | 8969d9924c662ab4cdacc342bbdc33756db730be (diff) | |
download | frameworks_base-b7e7bdfe784959ac8615851c2741eb9518a5afcf.zip frameworks_base-b7e7bdfe784959ac8615851c2741eb9518a5afcf.tar.gz frameworks_base-b7e7bdfe784959ac8615851c2741eb9518a5afcf.tar.bz2 |
- Add two sanity checks.
- Remove one unnecessary line.
- Clear the extendedData vector in DecryptHandle.
Change-Id: I2610c6d68f12d48cb69323a5eb2ae4b3b3e44dff
Diffstat (limited to 'drm/java')
-rwxr-xr-x | drm/java/android/drm/DrmRights.java | 35 |
1 files changed, 14 insertions, 21 deletions
diff --git a/drm/java/android/drm/DrmRights.java b/drm/java/android/drm/DrmRights.java index 5907956..ef9c21d 100755 --- a/drm/java/android/drm/DrmRights.java +++ b/drm/java/android/drm/DrmRights.java @@ -107,31 +107,24 @@ public class DrmRights { /** * Creates a <code>DrmRights</code> object with the given parameters. - *<p> - * The application can pass the processed data as a <code>String</code> or as binary data. - *<p> - * The following code snippet shows how to pass the processed data as a <code>String</code>: - *<p> - * new DrmRights(data.getBytes(), mimeType) - *<p> - * The following code snippet shows how to pass the processed data as binary data: - *<p> - * new DrmRights(binaryData[], mimeType) * - * @param data A {@link ProcessedData} object. + * @param data A {@link ProcessedData} object containing rights information. + * data could be null because it's optional for some DRM schemes. * @param mimeType The MIME type. */ public DrmRights(ProcessedData data, String mimeType) { - mData = data.getData(); - - String accountId = data.getAccountId(); - if (null != accountId && !accountId.equals("")) { - mAccountId = accountId; - } - - String subscriptionId = data.getSubscriptionId(); - if (null != subscriptionId && !subscriptionId.equals("")) { - mSubscriptionId = subscriptionId; + if (data != null) { + mData = data.getData(); + + String accountId = data.getAccountId(); + if (null != accountId && !accountId.equals("")) { + mAccountId = accountId; + } + + String subscriptionId = data.getSubscriptionId(); + if (null != subscriptionId && !subscriptionId.equals("")) { + mSubscriptionId = subscriptionId; + } } mMimeType = mimeType; |