diff options
author | Justin Klaassen <justinklaassen@google.com> | 2018-04-03 23:21:57 -0400 |
---|---|---|
committer | Justin Klaassen <justinklaassen@google.com> | 2018-04-03 23:21:57 -0400 |
commit | 4d01eeaffaa720e4458a118baa137a11614f00f7 (patch) | |
tree | 66751893566986236788e3c796a7cc5e90d05f52 /android/media/MediaDrm.java | |
parent | a192cc2a132cb0ee8588e2df755563ec7008c179 (diff) | |
download | android-28-4d01eeaffaa720e4458a118baa137a11614f00f7.tar.gz |
Import Android SDK Platform P [4697573]
/google/data/ro/projects/android/fetch_artifact \
--bid 4697573 \
--target sdk_phone_armv7-win_sdk \
sdk-repo-linux-sources-4697573.zip
AndroidVersion.ApiLevel has been modified to appear as 28
Change-Id: If80578c3c657366cc9cf75f8db13d46e2dd4e077
Diffstat (limited to 'android/media/MediaDrm.java')
-rw-r--r-- | android/media/MediaDrm.java | 541 |
1 files changed, 475 insertions, 66 deletions
diff --git a/android/media/MediaDrm.java b/android/media/MediaDrm.java index 063186d7..7ac15290 100644 --- a/android/media/MediaDrm.java +++ b/android/media/MediaDrm.java @@ -628,14 +628,48 @@ public final class MediaDrm implements AutoCloseable { } /** - * Open a new session with the MediaDrm object. A session ID is returned. + * Open a new session with the MediaDrm object. A session ID is returned. + * By default, sessions are opened at the native security level of the device. * * @throws NotProvisionedException if provisioning is needed * @throws ResourceBusyException if required resources are in use */ @NonNull - public native byte[] openSession() throws NotProvisionedException, - ResourceBusyException; + public byte[] openSession() throws NotProvisionedException, + ResourceBusyException { + return openSession(getMaxSecurityLevel()); + } + + /** + * Open a new session at a requested security level. The security level + * represents the robustness of the device's DRM implementation. By default, + * sessions are opened at the native security level of the device. + * Overriding the security level is necessary when the decrypted frames need + * to be manipulated, such as for image compositing. The security level + * parameter must be lower than the native level. Reducing the security + * level will typically limit the content to lower resolutions, as + * determined by the license policy. If the requested level is not + * supported, the next lower supported security level will be set. The level + * can be queried using {@link #getSecurityLevel}. A session + * ID is returned. + * + * @param level the new security level, one of + * {@link #SECURITY_LEVEL_SW_SECURE_CRYPTO}, + * {@link #SECURITY_LEVEL_SW_SECURE_DECODE}, + * {@link #SECURITY_LEVEL_HW_SECURE_CRYPTO}, + * {@link #SECURITY_LEVEL_HW_SECURE_DECODE} or + * {@link #SECURITY_LEVEL_HW_SECURE_ALL}. + * + * @throws NotProvisionedException if provisioning is needed + * @throws ResourceBusyException if required resources are in use + * @throws IllegalArgumentException if the requested security level is + * higher than the native level or lower than the lowest supported level or + * if the device does not support specifying the security level when opening + * a session + */ + @NonNull + public native byte[] openSession(@SecurityLevel int level) throws + NotProvisionedException, ResourceBusyException; /** * Close a session on the MediaDrm object that was previously opened @@ -671,7 +705,9 @@ public final class MediaDrm implements AutoCloseable { public @interface KeyType {} /** - * Contains the opaque data an app uses to request keys from a license server + * Contains the opaque data an app uses to request keys from a license server. + * These request types may or may not be generated by a given plugin. Refer + * to plugin vendor documentation for more information. */ public static final class KeyRequest { private byte[] mData; @@ -696,8 +732,8 @@ public final class MediaDrm implements AutoCloseable { public static final int REQUEST_TYPE_RELEASE = 2; /** - * Keys are already loaded. No license request is necessary, and no - * key request data is returned. + * Keys are already loaded and are available for use. No license request is necessary, and + * no key request data is returned. */ public static final int REQUEST_TYPE_NONE = 3; @@ -942,43 +978,84 @@ public final class MediaDrm implements AutoCloseable { throws DeniedByServerException; /** - * A means of enforcing limits on the number of concurrent streams per subscriber - * across devices is provided via SecureStop. This is achieved by securely - * monitoring the lifetime of sessions. + * Secure stops are a way to enforce limits on the number of concurrent + * streams per subscriber across devices. They provide secure monitoring of + * the lifetime of content decryption keys in MediaDrm sessions. + * <p> + * A secure stop is written to secure persistent memory when keys are loaded + * into a MediaDrm session. The secure stop state indicates that the keys + * are available for use. When playback completes and the keys are removed + * or the session is destroyed, the secure stop state is updated to indicate + * that keys are no longer usable. * <p> - * Information from the server related to the current playback session is written - * to persistent storage on the device when each MediaCrypto object is created. + * After playback, the app can query the secure stop and send it in a + * message to the license server confirming that the keys are no longer + * active. The license server returns a secure stop release response + * message to the app which then deletes the secure stop from persistent + * memory using {@link #releaseSecureStops}. * <p> - * In the normal case, playback will be completed, the session destroyed and the - * Secure Stops will be queried. The app queries secure stops and forwards the - * secure stop message to the server which verifies the signature and notifies the - * server side database that the session destruction has been confirmed. The persisted - * record on the client is only removed after positive confirmation that the server - * received the message using releaseSecureStops(). + * Each secure stop has a unique ID that can be used to identify it during + * enumeration, access and removal. + * @return a list of all secure stops from secure persistent memory */ @NonNull public native List<byte[]> getSecureStops(); /** - * Access secure stop by secure stop ID. + * Return a list of all secure stop IDs currently in persistent memory. + * The secure stop ID can be used to access or remove the corresponding + * secure stop. * - * @param ssid - The secure stop ID provided by the license server. + * @return a list of secure stop IDs + */ + @NonNull + public native List<byte[]> getSecureStopIds(); + + /** + * Access a specific secure stop given its secure stop ID. + * Each secure stop has a unique ID. + * + * @param ssid the ID of the secure stop to return + * @return the secure stop identified by ssid */ @NonNull public native byte[] getSecureStop(@NonNull byte[] ssid); /** - * Process the SecureStop server response message ssRelease. After authenticating - * the message, remove the SecureStops identified in the response. + * Process the secure stop server response message ssRelease. After + * authenticating the message, remove the secure stops identified in the + * response. * * @param ssRelease the server response indicating which secure stops to release */ public native void releaseSecureStops(@NonNull byte[] ssRelease); /** - * Remove all secure stops without requiring interaction with the server. + * Remove a specific secure stop without requiring a secure stop release message + * from the license server. + * @param ssid the ID of the secure stop to remove */ - public native void releaseAllSecureStops(); + public native void removeSecureStop(@NonNull byte[] ssid); + + /** + * Remove all secure stops without requiring a secure stop release message from + * the license server. + * + * This method was added in API 28. In API versions 18 through 27, + * {@link #releaseAllSecureStops} should be called instead. There is no need to + * do anything for API versions prior to 18. + */ + public native void removeAllSecureStops(); + + /** + * Remove all secure stops without requiring a secure stop release message from + * the license server. + * + * @deprecated Remove all secure stops using {@link #removeAllSecureStops} instead. + */ + public void releaseAllSecureStops() { + removeAllSecureStops();; + } @Retention(RetentionPolicy.SOURCE) @IntDef({HDCP_LEVEL_UNKNOWN, HDCP_NONE, HDCP_V1, HDCP_V2, @@ -1073,8 +1150,9 @@ public final class MediaDrm implements AutoCloseable { * implementation. */ @Retention(RetentionPolicy.SOURCE) - @IntDef({SECURITY_LEVEL_UNKNOWN, SW_SECURE_CRYPTO, SW_SECURE_DECODE, - HW_SECURE_CRYPTO, HW_SECURE_DECODE, HW_SECURE_ALL}) + @IntDef({SECURITY_LEVEL_UNKNOWN, SECURITY_LEVEL_SW_SECURE_CRYPTO, + SECURITY_LEVEL_SW_SECURE_DECODE, SECURITY_LEVEL_HW_SECURE_CRYPTO, + SECURITY_LEVEL_HW_SECURE_DECODE, SECURITY_LEVEL_HW_SECURE_ALL}) public @interface SecurityLevel {} /** @@ -1084,65 +1162,66 @@ public final class MediaDrm implements AutoCloseable { public static final int SECURITY_LEVEL_UNKNOWN = 0; /** - * Software-based whitebox crypto + * DRM key management uses software-based whitebox crypto. */ - public static final int SW_SECURE_CRYPTO = 1; + public static final int SECURITY_LEVEL_SW_SECURE_CRYPTO = 1; /** - * Software-based whitebox crypto and an obfuscated decoder + * DRM key management and decoding use software-based whitebox crypto. */ - public static final int SW_SECURE_DECODE = 2; + public static final int SECURITY_LEVEL_SW_SECURE_DECODE = 2; /** - * DRM key management and crypto operations are performed within a - * hardware backed trusted execution environment + * DRM key management and crypto operations are performed within a hardware + * backed trusted execution environment. */ - public static final int HW_SECURE_CRYPTO = 3; + public static final int SECURITY_LEVEL_HW_SECURE_CRYPTO = 3; /** - * DRM key management, crypto operations and decoding of content - * are performed within a hardware backed trusted execution environment + * DRM key management, crypto operations and decoding of content are + * performed within a hardware backed trusted execution environment. */ - public static final int HW_SECURE_DECODE = 4; + public static final int SECURITY_LEVEL_HW_SECURE_DECODE = 4; /** * DRM key management, crypto operations, decoding of content and all - * handling of the media (compressed and uncompressed) is handled within - * a hardware backed trusted execution environment. + * handling of the media (compressed and uncompressed) is handled within a + * hardware backed trusted execution environment. + */ + public static final int SECURITY_LEVEL_HW_SECURE_ALL = 5; + + /** + * The maximum security level supported by the device. This is the default + * security level when a session is opened. + * @hide + */ + public static final int SECURITY_LEVEL_MAX = 6; + + /** + * The maximum security level supported by the device. This is the default + * security level when a session is opened. */ - public static final int HW_SECURE_ALL = 5; + @SecurityLevel + public static final int getMaxSecurityLevel() { + return SECURITY_LEVEL_MAX; + } /** - * Return the current security level of a session. A session - * has an initial security level determined by the robustness of - * the DRM system's implementation on the device. The security - * level may be adjusted using {@link #setSecurityLevel}. + * Return the current security level of a session. A session has an initial + * security level determined by the robustness of the DRM system's + * implementation on the device. The security level may be changed at the + * time a session is opened using {@link #openSession}. * @param sessionId the session to query. * <p> * @return one of {@link #SECURITY_LEVEL_UNKNOWN}, - * {@link #SW_SECURE_CRYPTO}, {@link #SW_SECURE_DECODE}, - * {@link #HW_SECURE_CRYPTO}, {@link #HW_SECURE_DECODE} or - * {@link #HW_SECURE_ALL}. + * {@link #SECURITY_LEVEL_SW_SECURE_CRYPTO}, {@link #SECURITY_LEVEL_SW_SECURE_DECODE}, + * {@link #SECURITY_LEVEL_HW_SECURE_CRYPTO}, {@link #SECURITY_LEVEL_HW_SECURE_DECODE} or + * {@link #SECURITY_LEVEL_HW_SECURE_ALL}. */ @SecurityLevel public native int getSecurityLevel(@NonNull byte[] sessionId); /** - * Set the security level of a session. This can be useful if specific - * attributes of a lower security level are needed by an application, - * such as image manipulation or compositing. Reducing the security - * level will typically limit decryption to lower content resolutions, - * depending on the license policy. - * @param sessionId the session to set the security level on. - * @param level the new security level, one of - * {@link #SW_SECURE_CRYPTO}, {@link #SW_SECURE_DECODE}, - * {@link #HW_SECURE_CRYPTO}, {@link #HW_SECURE_DECODE} or - * {@link #HW_SECURE_ALL}. - */ - public native void setSecurityLevel(@NonNull byte[] sessionId, - @SecurityLevel int level); - - /** * String property name: identifies the maker of the DRM plugin */ public static final String PROPERTY_VENDOR = "vendor"; @@ -1253,8 +1332,6 @@ public final class MediaDrm implements AutoCloseable { * * Additional vendor-specific fields may also be present in * the return value. - * - * @hide - not part of the public API at this time */ public PersistableBundle getMetrics() { PersistableBundle bundle = getMetricsNative(); @@ -1571,8 +1648,6 @@ public final class MediaDrm implements AutoCloseable { /** * Definitions for the metrics that are reported via the * {@link #getMetrics} call. - * - * @hide - not part of the public API at this time */ public final static class MetricsConstants { @@ -1582,16 +1657,350 @@ public final class MediaDrm implements AutoCloseable { * Key to extract the number of successful {@link #openSession} calls * from the {@link PersistableBundle} returned by a * {@link #getMetrics} call. + * The count is a Long value ({@link android.os.BaseBundle#getLong}). */ public static final String OPEN_SESSION_OK_COUNT - = "/drm/mediadrm/open_session/ok/count"; + = "drm.mediadrm.open_session.ok.count"; /** * Key to extract the number of failed {@link #openSession} calls * from the {@link PersistableBundle} returned by a * {@link #getMetrics} call. + * The count is a Long value ({@link android.os.BaseBundle#getLong}). */ public static final String OPEN_SESSION_ERROR_COUNT - = "/drm/mediadrm/open_session/error/count"; + = "drm.mediadrm.open_session.error.count"; + + /** + * Key to extract the list of error codes that were returned from + * {@link #openSession} calls. The key is used to lookup the list + * in the {@link PersistableBundle} returned by a {@link #getMetrics} + * call. + * The list is an array of Long values + * ({@link android.os.BaseBundle#getLongArray}). + */ + public static final String OPEN_SESSION_ERROR_LIST + = "drm.mediadrm.open_session.error.list"; + + /** + * Key to extract the number of successful {@link #closeSession} calls + * from the {@link PersistableBundle} returned by a + * {@link #getMetrics} call. + * The count is a Long value ({@link android.os.BaseBundle#getLong}). + */ + public static final String CLOSE_SESSION_OK_COUNT + = "drm.mediadrm.close_session.ok.count"; + + /** + * Key to extract the number of failed {@link #closeSession} calls + * from the {@link PersistableBundle} returned by a + * {@link #getMetrics} call. + * The count is a Long value ({@link android.os.BaseBundle#getLong}). + */ + public static final String CLOSE_SESSION_ERROR_COUNT + = "drm.mediadrm.close_session.error.count"; + + /** + * Key to extract the list of error codes that were returned from + * {@link #closeSession} calls. The key is used to lookup the list + * in the {@link PersistableBundle} returned by a {@link #getMetrics} + * call. + * The list is an array of Long values + * ({@link android.os.BaseBundle#getLongArray}). + */ + public static final String CLOSE_SESSION_ERROR_LIST + = "drm.mediadrm.close_session.error.list"; + + /** + * Key to extract the start times of sessions. Times are + * represented as milliseconds since epoch (1970-01-01T00:00:00Z). + * The start times are returned from the {@link PersistableBundle} + * from a {@link #getMetrics} call. + * The start times are returned as another {@link PersistableBundle} + * containing the session ids as keys and the start times as long + * values. Use {@link android.os.BaseBundle#keySet} to get the list of + * session ids, and then {@link android.os.BaseBundle#getLong} to get + * the start time for each session. + */ + public static final String SESSION_START_TIMES_MS + = "drm.mediadrm.session_start_times_ms"; + + /** + * Key to extract the end times of sessions. Times are + * represented as milliseconds since epoch (1970-01-01T00:00:00Z). + * The end times are returned from the {@link PersistableBundle} + * from a {@link #getMetrics} call. + * The end times are returned as another {@link PersistableBundle} + * containing the session ids as keys and the end times as long + * values. Use {@link android.os.BaseBundle#keySet} to get the list of + * session ids, and then {@link android.os.BaseBundle#getLong} to get + * the end time for each session. + */ + public static final String SESSION_END_TIMES_MS + = "drm.mediadrm.session_end_times_ms"; + + /** + * Key to extract the number of successful {@link #getKeyRequest} calls + * from the {@link PersistableBundle} returned by a + * {@link #getMetrics} call. + * The count is a Long value ({@link android.os.BaseBundle#getLong}). + */ + public static final String GET_KEY_REQUEST_OK_COUNT + = "drm.mediadrm.get_key_request.ok.count"; + + /** + * Key to extract the number of failed {@link #getKeyRequest} + * calls from the {@link PersistableBundle} returned by a + * {@link #getMetrics} call. + * The count is a Long value ({@link android.os.BaseBundle#getLong}). + */ + public static final String GET_KEY_REQUEST_ERROR_COUNT + = "drm.mediadrm.get_key_request.error.count"; + + /** + * Key to extract the list of error codes that were returned from + * {@link #getKeyRequest} calls. The key is used to lookup the list + * in the {@link PersistableBundle} returned by a {@link #getMetrics} + * call. + * The list is an array of Long values + * ({@link android.os.BaseBundle#getLongArray}). + */ + public static final String GET_KEY_REQUEST_ERROR_LIST + = "drm.mediadrm.get_key_request.error.list"; + + /** + * Key to extract the average time in microseconds of calls to + * {@link #getKeyRequest}. The value is retrieved from the + * {@link PersistableBundle} returned from {@link #getMetrics}. + * The time is a Long value ({@link android.os.BaseBundle#getLong}). + */ + public static final String GET_KEY_REQUEST_OK_TIME_MICROS + = "drm.mediadrm.get_key_request.ok.average_time_micros"; + + /** + * Key to extract the number of successful {@link #provideKeyResponse} + * calls from the {@link PersistableBundle} returned by a + * {@link #getMetrics} call. + * The count is a Long value ({@link android.os.BaseBundle#getLong}). + */ + public static final String PROVIDE_KEY_RESPONSE_OK_COUNT + = "drm.mediadrm.provide_key_response.ok.count"; + + /** + * Key to extract the number of failed {@link #provideKeyResponse} + * calls from the {@link PersistableBundle} returned by a + * {@link #getMetrics} call. + * The count is a Long value ({@link android.os.BaseBundle#getLong}). + */ + public static final String PROVIDE_KEY_RESPONSE_ERROR_COUNT + = "drm.mediadrm.provide_key_response.error.count"; + + /** + * Key to extract the list of error codes that were returned from + * {@link #provideKeyResponse} calls. The key is used to lookup the + * list in the {@link PersistableBundle} returned by a + * {@link #getMetrics} call. + * The list is an array of Long values + * ({@link android.os.BaseBundle#getLongArray}). + */ + public static final String PROVIDE_KEY_RESPONSE_ERROR_LIST + = "drm.mediadrm.provide_key_response.error.list"; + + /** + * Key to extract the average time in microseconds of calls to + * {@link #provideKeyResponse}. The valus is retrieved from the + * {@link PersistableBundle} returned from {@link #getMetrics}. + * The time is a Long value ({@link android.os.BaseBundle#getLong}). + */ + public static final String PROVIDE_KEY_RESPONSE_OK_TIME_MICROS + = "drm.mediadrm.provide_key_response.ok.average_time_micros"; + + /** + * Key to extract the number of successful {@link #getProvisionRequest} + * calls from the {@link PersistableBundle} returned by a + * {@link #getMetrics} call. + * The count is a Long value ({@link android.os.BaseBundle#getLong}). + */ + public static final String GET_PROVISION_REQUEST_OK_COUNT + = "drm.mediadrm.get_provision_request.ok.count"; + + /** + * Key to extract the number of failed {@link #getProvisionRequest} + * calls from the {@link PersistableBundle} returned by a + * {@link #getMetrics} call. + * The count is a Long value ({@link android.os.BaseBundle#getLong}). + */ + public static final String GET_PROVISION_REQUEST_ERROR_COUNT + = "drm.mediadrm.get_provision_request.error.count"; + + /** + * Key to extract the list of error codes that were returned from + * {@link #getProvisionRequest} calls. The key is used to lookup the + * list in the {@link PersistableBundle} returned by a + * {@link #getMetrics} call. + * The list is an array of Long values + * ({@link android.os.BaseBundle#getLongArray}). + */ + public static final String GET_PROVISION_REQUEST_ERROR_LIST + = "drm.mediadrm.get_provision_request.error.list"; + + /** + * Key to extract the number of successful + * {@link #provideProvisionResponse} calls from the + * {@link PersistableBundle} returned by a {@link #getMetrics} call. + * The count is a Long value ({@link android.os.BaseBundle#getLong}). + */ + public static final String PROVIDE_PROVISION_RESPONSE_OK_COUNT + = "drm.mediadrm.provide_provision_response.ok.count"; + + /** + * Key to extract the number of failed + * {@link #provideProvisionResponse} calls from the + * {@link PersistableBundle} returned by a {@link #getMetrics} call. + * The count is a Long value ({@link android.os.BaseBundle#getLong}). + */ + public static final String PROVIDE_PROVISION_RESPONSE_ERROR_COUNT + = "drm.mediadrm.provide_provision_response.error.count"; + + /** + * Key to extract the list of error codes that were returned from + * {@link #provideProvisionResponse} calls. The key is used to lookup + * the list in the {@link PersistableBundle} returned by a + * {@link #getMetrics} call. + * The list is an array of Long values + * ({@link android.os.BaseBundle#getLongArray}). + */ + public static final String PROVIDE_PROVISION_RESPONSE_ERROR_LIST + = "drm.mediadrm.provide_provision_response.error.list"; + + /** + * Key to extract the number of successful + * {@link #getPropertyByteArray} calls were made with the + * {@link #PROPERTY_DEVICE_UNIQUE_ID} value. The key is used to lookup + * the value in the {@link PersistableBundle} returned by a + * {@link #getMetrics} call. + * The count is a Long value ({@link android.os.BaseBundle#getLong}). + */ + public static final String GET_DEVICE_UNIQUE_ID_OK_COUNT + = "drm.mediadrm.get_device_unique_id.ok.count"; + + /** + * Key to extract the number of failed + * {@link #getPropertyByteArray} calls were made with the + * {@link #PROPERTY_DEVICE_UNIQUE_ID} value. The key is used to lookup + * the value in the {@link PersistableBundle} returned by a + * {@link #getMetrics} call. + * The count is a Long value ({@link android.os.BaseBundle#getLong}). + */ + public static final String GET_DEVICE_UNIQUE_ID_ERROR_COUNT + = "drm.mediadrm.get_device_unique_id.error.count"; + + /** + * Key to extract the list of error codes that were returned from + * {@link #getPropertyByteArray} calls with the + * {@link #PROPERTY_DEVICE_UNIQUE_ID} value. The key is used to lookup + * the list in the {@link PersistableBundle} returned by a + * {@link #getMetrics} call. + * The list is an array of Long values + * ({@link android.os.BaseBundle#getLongArray}). + */ + public static final String GET_DEVICE_UNIQUE_ID_ERROR_LIST + = "drm.mediadrm.get_device_unique_id.error.list"; + + /** + * Key to extraact the count of {@link KeyStatus#STATUS_EXPIRED} events + * that occured. The count is extracted from the + * {@link PersistableBundle} returned from a {@link #getMetrics} call. + * The count is a Long value ({@link android.os.BaseBundle#getLong}). + */ + public static final String KEY_STATUS_EXPIRED_COUNT + = "drm.mediadrm.key_status.EXPIRED.count"; + + /** + * Key to extract the count of {@link KeyStatus#STATUS_INTERNAL_ERROR} + * events that occured. The count is extracted from the + * {@link PersistableBundle} returned from a {@link #getMetrics} call. + * The count is a Long value ({@link android.os.BaseBundle#getLong}). + */ + public static final String KEY_STATUS_INTERNAL_ERROR_COUNT + = "drm.mediadrm.key_status.INTERNAL_ERROR.count"; + + /** + * Key to extract the count of + * {@link KeyStatus#STATUS_OUTPUT_NOT_ALLOWED} events that occured. + * The count is extracted from the + * {@link PersistableBundle} returned from a {@link #getMetrics} call. + * The count is a Long value ({@link android.os.BaseBundle#getLong}). + */ + public static final String KEY_STATUS_OUTPUT_NOT_ALLOWED_COUNT + = "drm.mediadrm.key_status_change.OUTPUT_NOT_ALLOWED.count"; + + /** + * Key to extract the count of {@link KeyStatus#STATUS_PENDING} + * events that occured. The count is extracted from the + * {@link PersistableBundle} returned from a {@link #getMetrics} call. + * The count is a Long value ({@link android.os.BaseBundle#getLong}). + */ + public static final String KEY_STATUS_PENDING_COUNT + = "drm.mediadrm.key_status_change.PENDING.count"; + + /** + * Key to extract the count of {@link KeyStatus#STATUS_USABLE} + * events that occured. The count is extracted from the + * {@link PersistableBundle} returned from a {@link #getMetrics} call. + * The count is a Long value ({@link android.os.BaseBundle#getLong}). + */ + public static final String KEY_STATUS_USABLE_COUNT + = "drm.mediadrm.key_status_change.USABLE.count"; + + /** + * Key to extract the count of {@link OnEventListener#onEvent} + * calls of type PROVISION_REQUIRED occured. The count is + * extracted from the {@link PersistableBundle} returned from a + * {@link #getMetrics} call. + * The count is a Long value ({@link android.os.BaseBundle#getLong}). + */ + public static final String EVENT_PROVISION_REQUIRED_COUNT + = "drm.mediadrm.event.PROVISION_REQUIRED.count"; + + /** + * Key to extract the count of {@link OnEventListener#onEvent} + * calls of type KEY_NEEDED occured. The count is + * extracted from the {@link PersistableBundle} returned from a + * {@link #getMetrics} call. + * The count is a Long value ({@link android.os.BaseBundle#getLong}). + */ + public static final String EVENT_KEY_NEEDED_COUNT + = "drm.mediadrm.event.KEY_NEEDED.count"; + + /** + * Key to extract the count of {@link OnEventListener#onEvent} + * calls of type KEY_EXPIRED occured. The count is + * extracted from the {@link PersistableBundle} returned from a + * {@link #getMetrics} call. + * The count is a Long value ({@link android.os.BaseBundle#getLong}). + */ + public static final String EVENT_KEY_EXPIRED_COUNT + = "drm.mediadrm.event.KEY_EXPIRED.count"; + + /** + * Key to extract the count of {@link OnEventListener#onEvent} + * calls of type VENDOR_DEFINED. The count is + * extracted from the {@link PersistableBundle} returned from a + * {@link #getMetrics} call. + * The count is a Long value ({@link android.os.BaseBundle#getLong}). + */ + public static final String EVENT_VENDOR_DEFINED_COUNT + = "drm.mediadrm.event.VENDOR_DEFINED.count"; + + /** + * Key to extract the count of {@link OnEventListener#onEvent} + * calls of type SESSION_RECLAIMED. The count is + * extracted from the {@link PersistableBundle} returned from a + * {@link #getMetrics} call. + * The count is a Long value ({@link android.os.BaseBundle#getLong}). + */ + public static final String EVENT_SESSION_RECLAIMED_COUNT + = "drm.mediadrm.event.SESSION_RECLAIMED.count"; } } |