Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit def35f7a authored by Gloria Wang's avatar Gloria Wang Committed by Android (Google) Code Review
Browse files

Merge "Fix for 4089881. - Add one more parameter in the interface of DrmEvent...

Merge "Fix for 4089881. - Add one more parameter in the interface of DrmEvent and its subclasses   DrmInfoEvent and DrmErrorEvent - Send back DrmInfo in the response of async processDrmInfo calls" into honeycomb-mr1
parents 87f50f19 f8bf3c46
Loading
Loading
Loading
Loading
+0 −2
Original line number Diff line number Diff line
@@ -73375,8 +73375,6 @@
</parameter>
<parameter name="event" type="android.drm.DrmEvent">
</parameter>
<parameter name="attributes" type="java.util.HashMap&lt;java.lang.String, java.lang.Object&gt;">
</parameter>
</method>
</interface>
<interface name="DrmManagerClient.OnInfoListener"
+73 −3
Original line number Diff line number Diff line
@@ -72665,6 +72665,22 @@
<parameter name="message" type="java.lang.String">
</parameter>
</constructor>
<constructor name="DrmErrorEvent"
 type="android.drm.DrmErrorEvent"
 static="false"
 final="false"
 deprecated="not deprecated"
 visibility="public"
>
<parameter name="uniqueId" type="int">
</parameter>
<parameter name="type" type="int">
</parameter>
<parameter name="message" type="java.lang.String">
</parameter>
<parameter name="attributes" type="java.util.HashMap&lt;java.lang.String, java.lang.Object&gt;">
</parameter>
</constructor>
<field name="TYPE_ACQUIRE_DRM_INFO_FAILED"
 type="int"
 transient="false"
@@ -72775,7 +72791,36 @@
</parameter>
<parameter name="message" type="java.lang.String">
</parameter>
<parameter name="attributes" type="java.util.HashMap&lt;java.lang.String, java.lang.Object&gt;">
</parameter>
</constructor>
<constructor name="DrmEvent"
 type="android.drm.DrmEvent"
 static="false"
 final="false"
 deprecated="not deprecated"
 visibility="protected"
>
<parameter name="uniqueId" type="int">
</parameter>
<parameter name="type" type="int">
</parameter>
<parameter name="message" type="java.lang.String">
</parameter>
</constructor>
<method name="getAttribute"
 return="java.lang.Object"
 abstract="false"
 native="false"
 synchronized="false"
 static="false"
 final="false"
 deprecated="not deprecated"
 visibility="public"
>
<parameter name="key" type="java.lang.String">
</parameter>
</method>
<method name="getMessage"
 return="java.lang.String"
 abstract="false"
@@ -72809,6 +72854,17 @@
 visibility="public"
>
</method>
<field name="DRM_INFO_OBJECT"
 type="java.lang.String"
 transient="false"
 volatile="false"
 value="&quot;drm_info_object&quot;"
 static="true"
 final="true"
 deprecated="not deprecated"
 visibility="public"
>
</field>
<field name="DRM_INFO_STATUS_OBJECT"
 type="java.lang.String"
 transient="false"
@@ -72985,6 +73041,22 @@
<parameter name="message" type="java.lang.String">
</parameter>
</constructor>
<constructor name="DrmInfoEvent"
 type="android.drm.DrmInfoEvent"
 static="false"
 final="false"
 deprecated="not deprecated"
 visibility="public"
>
<parameter name="uniqueId" type="int">
</parameter>
<parameter name="type" type="int">
</parameter>
<parameter name="message" type="java.lang.String">
</parameter>
<parameter name="attributes" type="java.util.HashMap&lt;java.lang.String, java.lang.Object&gt;">
</parameter>
</constructor>
<field name="TYPE_ACCOUNT_ALREADY_REGISTERED"
 type="int"
 transient="false"
@@ -73767,8 +73839,6 @@
</parameter>
<parameter name="event" type="android.drm.DrmEvent">
</parameter>
<parameter name="attributes" type="java.util.HashMap&lt;java.lang.String, java.lang.Object&gt;">
</parameter>
</method>
</interface>
<interface name="DrmManagerClient.OnInfoListener"
@@ -267075,7 +267145,7 @@
 deprecated="not deprecated"
 visibility="public"
>
<parameter name="t" type="T">
<parameter name="arg0" type="T">
</parameter>
</method>
</interface>
+17 −1
Original line number Diff line number Diff line
@@ -16,6 +16,8 @@

package android.drm;

import java.util.HashMap;

/**
 * This is an entity class which would be passed to caller in
 * {@link DrmManagerClient.OnErrorListener#onError(DrmManagerClient, DrmErrorEvent)}
@@ -62,11 +64,25 @@ public class DrmErrorEvent extends DrmEvent {
     * constructor to create DrmErrorEvent object with given parameters
     *
     * @param uniqueId Unique session identifier
     * @param type Type of information
     * @param type Type of the event. It could be one of the types defined above
     * @param message Message description
     */
    public DrmErrorEvent(int uniqueId, int type, String message) {
        super(uniqueId, type, message);
    }

    /**
     * constructor to create DrmErrorEvent object with given parameters
     *
     * @param uniqueId Unique session identifier
     * @param type Type of the event. It could be one of the types defined above
     * @param message Message description
     * @param attributes Attributes for extensible information. Could be any
     * information provided by the plugin
     */
    public DrmErrorEvent(int uniqueId, int type, String message,
                            HashMap<String, Object> attributes) {
        super(uniqueId, type, message, attributes);
    }
}
+37 −0
Original line number Diff line number Diff line
@@ -16,6 +16,8 @@

package android.drm;

import java.util.HashMap;

/**
 * This is the base class which would be used to notify the caller
 * about any event occurred in DRM framework.
@@ -33,11 +35,36 @@ public class DrmEvent {
    public static final int TYPE_DRM_INFO_PROCESSED = 1002;

    public static final String DRM_INFO_STATUS_OBJECT = "drm_info_status_object";
    public static final String DRM_INFO_OBJECT = "drm_info_object";

    private final int mUniqueId;
    private final int mType;
    private String mMessage = "";

    private HashMap<String, Object> mAttributes = new HashMap<String, Object>();

    /**
     * constructor for DrmEvent class
     *
     * @param uniqueId Unique session identifier
     * @param type Type of information
     * @param message Message description
     * @param attributes Attributes for extensible information
     */
    protected DrmEvent(int uniqueId, int type, String message,
                            HashMap<String, Object> attributes) {
        mUniqueId = uniqueId;
        mType = type;

        if (null != message) {
            mMessage = message;
        }

        if (null != attributes) {
            mAttributes = attributes;
        }
    }

    /**
     * constructor for DrmEvent class
     *
@@ -80,5 +107,15 @@ public class DrmEvent {
    public String getMessage() {
        return mMessage;
    }

    /**
     * Returns the attribute corresponding to the specified key
     *
     * @return one of the attributes or null if no mapping for
     * the key is found
     */
    public Object getAttribute(String key) {
        return mAttributes.get(key);
    }
}
+17 −1
Original line number Diff line number Diff line
@@ -16,6 +16,8 @@

package android.drm;

import java.util.HashMap;

/**
 * This is an entity class which would be passed to caller in
 * {@link DrmManagerClient.OnInfoListener#onInfo(DrmManagerClient, DrmInfoEvent)}
@@ -54,11 +56,25 @@ public class DrmInfoEvent extends DrmEvent {
     * constructor to create DrmInfoEvent object with given parameters
     *
     * @param uniqueId Unique session identifier
     * @param type Type of information
     * @param type Type of the event. It could be one of the types defined above
     * @param message Message description
     */
    public DrmInfoEvent(int uniqueId, int type, String message) {
        super(uniqueId, type, message);
    }

    /**
     * constructor to create DrmInfoEvent object with given parameters
     *
     * @param uniqueId Unique session identifier
     * @param type Type of the event. It could be one of the types defined above
     * @param message Message description
     * @param attributes Attributes for extensible information. Could be any
     * information provided by the plugin
     */
    public DrmInfoEvent(int uniqueId, int type, String message,
                            HashMap<String, Object> attributes) {
        super(uniqueId, type, message, attributes);
    }
}
Loading