summaryrefslogtreecommitdiffstats
path: root/drm
diff options
context:
space:
mode:
authorGloria Wang <gwang@google.com>2011-03-14 12:04:15 -0700
committerGloria Wang <gwang@google.com>2011-03-14 15:29:08 -0700
commit27b277779c89251f2aafcc7a56db95d264900c9d (patch)
tree9bec6bf81a5b201b570c8d1a3255c50905679d47 /drm
parent3ec9d06f070db3a8899ad235736abd0ffaf6f578 (diff)
downloadframeworks_base-27b277779c89251f2aafcc7a56db95d264900c9d.zip
frameworks_base-27b277779c89251f2aafcc7a56db95d264900c9d.tar.gz
frameworks_base-27b277779c89251f2aafcc7a56db95d264900c9d.tar.bz2
For issue 4082089
Add more info and error events into the DRM framework Change-Id: I0bb3251c5947fc8e977d478e1ba46b242cb97e9d
Diffstat (limited to 'drm')
-rw-r--r--drm/java/android/drm/DrmErrorEvent.java4
-rw-r--r--drm/java/android/drm/DrmInfoEvent.java4
-rw-r--r--drm/java/android/drm/DrmManagerClient.java16
3 files changed, 18 insertions, 6 deletions
diff --git a/drm/java/android/drm/DrmErrorEvent.java b/drm/java/android/drm/DrmErrorEvent.java
index 20fd8aa..90adb47f 100644
--- a/drm/java/android/drm/DrmErrorEvent.java
+++ b/drm/java/android/drm/DrmErrorEvent.java
@@ -53,6 +53,10 @@ public class DrmErrorEvent extends DrmEvent {
* associated with all DRM schemes.
*/
public static final int TYPE_REMOVE_ALL_RIGHTS_FAILED = 2007;
+ /**
+ * TYPE_ACQUIRE_DRM_INFO_FAILED, when failed to acquire DrmInfo.
+ */
+ public static final int TYPE_ACQUIRE_DRM_INFO_FAILED = 2008;
/**
* constructor to create DrmErrorEvent object with given parameters
diff --git a/drm/java/android/drm/DrmInfoEvent.java b/drm/java/android/drm/DrmInfoEvent.java
index a778e06..72f37ea 100644
--- a/drm/java/android/drm/DrmInfoEvent.java
+++ b/drm/java/android/drm/DrmInfoEvent.java
@@ -45,6 +45,10 @@ public class DrmInfoEvent extends DrmEvent {
* already done for the given account.
*/
public static final int TYPE_ACCOUNT_ALREADY_REGISTERED = 5;
+ /**
+ * TYPE_RIGHTS_REMOVED, when the rights has been removed.
+ */
+ public static final int TYPE_RIGHTS_REMOVED = 6;
/**
* constructor to create DrmInfoEvent object with given parameters
diff --git a/drm/java/android/drm/DrmManagerClient.java b/drm/java/android/drm/DrmManagerClient.java
index 782ffdb..aa56159 100644
--- a/drm/java/android/drm/DrmManagerClient.java
+++ b/drm/java/android/drm/DrmManagerClient.java
@@ -181,7 +181,7 @@ public class DrmManagerClient {
}
public void handleMessage(Message msg) {
- DrmInfoEvent event = null;
+ DrmInfoEvent info = null;
DrmErrorEvent error = null;
switch (msg.what) {
@@ -197,11 +197,15 @@ public class DrmManagerClient {
} catch (IOException e) {
e.printStackTrace();
}
- event = new DrmInfoEvent(uniqueId, infoType, message);
+ info = new DrmInfoEvent(uniqueId, infoType, message);
break;
}
- case DrmInfoEvent.TYPE_ALREADY_REGISTERED_BY_ANOTHER_ACCOUNT: {
- event = new DrmInfoEvent(uniqueId, infoType, message);
+ case DrmInfoEvent.TYPE_ALREADY_REGISTERED_BY_ANOTHER_ACCOUNT:
+ case DrmInfoEvent.TYPE_RIGHTS_INSTALLED:
+ case DrmInfoEvent.TYPE_WAIT_FOR_RIGHTS:
+ case DrmInfoEvent.TYPE_ACCOUNT_ALREADY_REGISTERED:
+ case DrmInfoEvent.TYPE_RIGHTS_REMOVED: {
+ info = new DrmInfoEvent(uniqueId, infoType, message);
break;
}
default:
@@ -209,8 +213,8 @@ public class DrmManagerClient {
break;
}
- if (null != mOnInfoListener && null != event) {
- mOnInfoListener.onInfo(DrmManagerClient.this, event);
+ if (null != mOnInfoListener && null != info) {
+ mOnInfoListener.onInfo(DrmManagerClient.this, info);
}
if (null != mOnErrorListener && null != error) {
mOnErrorListener.onError(DrmManagerClient.this, error);