drm: add EVENT_SESSION_RECLAIMED for resource manager.
Bug: 19265536
Change-Id: Ifa15a4c7d3a7c20cb00bd4aefb57d239c0efaafa
diff --git a/api/current.txt b/api/current.txt
index 118223c..5f513ca 100644
--- a/api/current.txt
+++ b/api/current.txt
@@ -15057,6 +15057,7 @@
field public static final int EVENT_KEY_EXPIRED = 3; // 0x3
field public static final int EVENT_KEY_REQUIRED = 2; // 0x2
field public static final int EVENT_PROVISION_REQUIRED = 1; // 0x1
+ field public static final int EVENT_SESSION_RECLAIMED = 5; // 0x5
field public static final int EVENT_VENDOR_DEFINED = 4; // 0x4
field public static final int KEY_TYPE_OFFLINE = 2; // 0x2
field public static final int KEY_TYPE_RELEASE = 3; // 0x3
diff --git a/api/system-current.txt b/api/system-current.txt
index 903c40c..16d6234 100644
--- a/api/system-current.txt
+++ b/api/system-current.txt
@@ -16051,6 +16051,7 @@
field public static final int EVENT_KEY_EXPIRED = 3; // 0x3
field public static final int EVENT_KEY_REQUIRED = 2; // 0x2
field public static final int EVENT_PROVISION_REQUIRED = 1; // 0x1
+ field public static final int EVENT_SESSION_RECLAIMED = 5; // 0x5
field public static final int EVENT_VENDOR_DEFINED = 4; // 0x4
field public static final int KEY_TYPE_OFFLINE = 2; // 0x2
field public static final int KEY_TYPE_RELEASE = 3; // 0x3
diff --git a/media/java/android/media/MediaDrm.java b/media/java/android/media/MediaDrm.java
index 78a5abe..12e000c 100644
--- a/media/java/android/media/MediaDrm.java
+++ b/media/java/android/media/MediaDrm.java
@@ -277,6 +277,12 @@
*/
public static final int EVENT_VENDOR_DEFINED = 4;
+ /**
+ * This event indicates that a session opened by the app has been reclaimed by the resource
+ * manager.
+ */
+ public static final int EVENT_SESSION_RECLAIMED = 5;
+
private static final int DRM_EVENT = 200;
private class EventHandler extends Handler
diff --git a/media/jni/android_media_MediaDrm.cpp b/media/jni/android_media_MediaDrm.cpp
index d9de7a9..a3447b8 100644
--- a/media/jni/android_media_MediaDrm.cpp
+++ b/media/jni/android_media_MediaDrm.cpp
@@ -92,6 +92,7 @@
jint kEventKeyRequired;
jint kEventKeyExpired;
jint kEventVendorDefined;
+ jint kEventSessionReclaimed;
} gEventTypes;
struct KeyTypes {
@@ -194,6 +195,9 @@
case DrmPlugin::kDrmPluginEventVendorDefined:
jeventType = gEventTypes.kEventVendorDefined;
break;
+ case DrmPlugin::kDrmPluginEventSessionReclaimed:
+ jeventType = gEventTypes.kEventSessionReclaimed;
+ break;
default:
ALOGE("Invalid event DrmPlugin::EventType %d, ignored", (int)eventType);
return;
@@ -565,6 +569,8 @@
gEventTypes.kEventKeyExpired = env->GetStaticIntField(clazz, field);
GET_STATIC_FIELD_ID(field, clazz, "EVENT_VENDOR_DEFINED", "I");
gEventTypes.kEventVendorDefined = env->GetStaticIntField(clazz, field);
+ GET_STATIC_FIELD_ID(field, clazz, "EVENT_SESSION_RECLAIMED", "I");
+ gEventTypes.kEventSessionReclaimed = env->GetStaticIntField(clazz, field);
GET_STATIC_FIELD_ID(field, clazz, "KEY_TYPE_STREAMING", "I");
gKeyTypes.kKeyTypeStreaming = env->GetStaticIntField(clazz, field);