IT. Expert System.

Android Reference

DrmManagerClient


android.drm

Class DrmManagerClient



  • public class DrmManagerClient
    extends Object
    The main programming interface for the DRM framework. An application must instantiate this class to access DRM agents through the DRM framework.
    • Field Detail

      • ERROR_NONE

        public static final int ERROR_NONE
        Indicates that a request was successful or that no error occurred.
        See Also:
        Constant Field Values
      • ERROR_UNKNOWN

        public static final int ERROR_UNKNOWN
        Indicates that an error occurred and the reason is not known.
        See Also:
        Constant Field Values
    • Constructor Detail

      • DrmManagerClient

        public DrmManagerClient(Context context)
        Creates a DrmManagerClient.
        Parameters:
        context - Context of the caller.
    • Method Detail

      • notify

        public static void notify(Object thisReference,
                  int uniqueId,
                  int infoType,
                  String message)
      • finalize

        protected void finalize()
        Description copied from class: Object
        Invoked when the garbage collector has detected that this instance is no longer reachable. The default implementation does nothing, but this method can be overridden to free resources.

        Note that objects that override finalize are significantly more expensive than objects that don't. Finalizers may be run a long time after the object is no longer reachable, depending on memory pressure, so it's a bad idea to rely on them for cleanup. Note also that finalizers are run on a single VM-wide finalizer thread, so doing blocking work in a finalizer is a bad idea. A finalizer is usually only necessary for a class that has a native peer and needs to call a native method to destroy that peer. Even then, it's better to provide an explicit close method (and implement Closeable), and insist that callers manually dispose of instances. This works well for something like files, but less well for something like a BigInteger where typical calling code would have to deal with lots of temporaries. Unfortunately, code that creates lots of temporaries is the worst kind of code from the point of view of the single finalizer thread.

        If you must use finalizers, consider at least providing your own ReferenceQueue and having your own thread process that queue.

        Unlike constructors, finalizers are not automatically chained. You are responsible for calling super.finalize() yourself.

        Uncaught exceptions thrown by finalizers are ignored and do not terminate the finalizer thread. See Effective Java Item 7, "Avoid finalizers" for more.

        Overrides:
        finalize in class Object
      • release

        public void release()
        Releases resources associated with the current session of DrmManagerClient. It is considered good practice to call this method when the DrmManagerClient object is no longer needed in your application. After release() is called, DrmManagerClient is no longer usable since it has lost all of its required resource.
      • setOnInfoListener

        public void setOnInfoListener(DrmManagerClient.OnInfoListener infoListener)
        Registers an DrmManagerClient.OnInfoListener callback, which is invoked when the DRM framework sends status or warning information during registration or rights acquisition.
        Parameters:
        infoListener - Interface definition for the callback.
      • getAvailableDrmEngines

        public String[] getAvailableDrmEngines()
        Retrieves information about all the DRM plug-ins (agents) that are registered with the DRM framework.
        Returns:
        A String array of DRM plug-in descriptions.
      • getConstraints

        public ContentValues getConstraints(String path,
                                   int action)
        Retrieves constraint information for rights-protected content.
        Parameters:
        path - Path to the content from which you are retrieving DRM constraints.
        action - Action defined in DrmStore.Action.
        Returns:
        A ContentValues instance that contains key-value pairs representing the constraints. Null in case of failure. The keys are defined in DrmStore.ConstraintsColumns.
      • getMetadata

        public ContentValues getMetadata(String path)
        Retrieves metadata information for rights-protected content.
        Parameters:
        path - Path to the content from which you are retrieving metadata information.
        Returns:
        A ContentValues instance that contains key-value pairs representing the metadata. Null in case of failure.
      • getConstraints

        public ContentValues getConstraints(Uri uri,
                                   int action)
        Retrieves constraint information for rights-protected content.
        Parameters:
        uri - URI for the content from which you are retrieving DRM constraints.
        action - Action defined in DrmStore.Action.
        Returns:
        A ContentValues instance that contains key-value pairs representing the constraints. Null in case of failure.
      • getMetadata

        public ContentValues getMetadata(Uri uri)
        Retrieves metadata information for rights-protected content.
        Parameters:
        uri - URI for the content from which you are retrieving metadata information.
        Returns:
        A ContentValues instance that contains key-value pairs representing the constraints. Null in case of failure.
      • saveRights

        public int saveRights(DrmRights drmRights,
                     String rightsPath,
                     String contentPath)
                       throws IOException
        Saves rights to a specified path and associates that path with the content path.

        Note: For OMA or WM-DRM, rightsPath and contentPath can be null.

        Parameters:
        drmRights - The DrmRights to be saved.
        rightsPath - File path where rights will be saved.
        contentPath - File path where content is saved.
        Returns:
        ERROR_NONE for success; ERROR_UNKNOWN for failure.
        Throws:
        IOException - If the call failed to save rights information at the given rightsPath.
      • installDrmEngine

        public void installDrmEngine(String engineFilePath)
        Installs a new DRM plug-in (agent) at runtime.
        Parameters:
        engineFilePath - File path to the plug-in file to be installed.
      • canHandle

        public boolean canHandle(String path,
                        String mimeType)
        Checks whether the given MIME type or path can be handled.
        Parameters:
        path - Path of the content to be handled.
        mimeType - MIME type of the object to be handled.
        Returns:
        True if the given MIME type or path can be handled; false if they cannot be handled.
      • canHandle

        public boolean canHandle(Uri uri,
                        String mimeType)
        Checks whether the given MIME type or URI can be handled.
        Parameters:
        uri - URI for the content to be handled.
        mimeType - MIME type of the object to be handled
        Returns:
        True if the given MIME type or URI can be handled; false if they cannot be handled.
      • processDrmInfo

        public int processDrmInfo(DrmInfo drmInfo)
        Processes the given DRM information based on the information type.
        Parameters:
        drmInfo - The DrmInfo to be processed.
        Returns:
        ERROR_NONE for success; ERROR_UNKNOWN for failure.
      • acquireDrmInfo

        public DrmInfo acquireDrmInfo(DrmInfoRequest drmInfoRequest)
        Retrieves information for registering, unregistering, or acquiring rights.
        Parameters:
        drmInfoRequest - The DrmInfoRequest that specifies the type of DRM information being retrieved.
        Returns:
        A DrmInfo instance.
      • acquireRights

        public int acquireRights(DrmInfoRequest drmInfoRequest)
        Processes a given DrmInfoRequest and returns the rights information asynchronously.

        This is a utility method that consists of an acquireDrmInfo() and a processDrmInfo() method call. This utility method can be used only if the selected DRM plug-in (agent) supports this sequence of calls. Some DRM agents, such as OMA, do not support this utility method, in which case an application must invoke acquireDrmInfo() and processDrmInfo() separately.

        Parameters:
        drmInfoRequest - The DrmInfoRequest used to acquire the rights.
        Returns:
        ERROR_NONE for success; ERROR_UNKNOWN for failure.
      • getDrmObjectType

        public int getDrmObjectType(String path,
                           String mimeType)
        Retrieves the type of rights-protected object (for example, content object, rights object, and so on) using the specified path or MIME type. At least one parameter must be specified to retrieve the DRM object type.
        Parameters:
        path - Path to the content or null.
        mimeType - MIME type of the content or null.
        Returns:
        An int that corresponds to a DrmStore.DrmObjectType.
      • getDrmObjectType

        public int getDrmObjectType(Uri uri,
                           String mimeType)
        Retrieves the type of rights-protected object (for example, content object, rights object, and so on) using the specified URI or MIME type. At least one parameter must be specified to retrieve the DRM object type.
        Parameters:
        uri - URI for the content or null.
        mimeType - MIME type of the content or null.
        Returns:
        An int that corresponds to a DrmStore.DrmObjectType.
      • getOriginalMimeType

        public String getOriginalMimeType(String path)
        Retrieves the MIME type embedded in the original content.
        Parameters:
        path - Path to the rights-protected content.
        Returns:
        The MIME type of the original content, such as video/mpeg.
      • getOriginalMimeType

        public String getOriginalMimeType(Uri uri)
        Retrieves the MIME type embedded in the original content.
        Parameters:
        uri - URI of the rights-protected content.
        Returns:
        MIME type of the original content, such as video/mpeg.
      • checkRightsStatus

        public int checkRightsStatus(String path)
        Checks whether the given content has valid rights.
        Parameters:
        path - Path to the rights-protected content.
        Returns:
        An int representing the DrmStore.RightsStatus of the content.
      • checkRightsStatus

        public int checkRightsStatus(Uri uri)
        Check whether the given content has valid rights.
        Parameters:
        uri - URI of the rights-protected content.
        Returns:
        An int representing the DrmStore.RightsStatus of the content.
      • checkRightsStatus

        public int checkRightsStatus(String path,
                            int action)
        Checks whether the given rights-protected content has valid rights for the specified DrmStore.Action.
        Parameters:
        path - Path to the rights-protected content.
        action - The DrmStore.Action to perform.
        Returns:
        An int representing the DrmStore.RightsStatus of the content.
      • checkRightsStatus

        public int checkRightsStatus(Uri uri,
                            int action)
        Checks whether the given rights-protected content has valid rights for the specified DrmStore.Action.
        Parameters:
        uri - URI for the rights-protected content.
        action - The DrmStore.Action to perform.
        Returns:
        An int representing the DrmStore.RightsStatus of the content.
      • removeRights

        public int removeRights(String path)
        Removes the rights associated with the given rights-protected content.
        Parameters:
        path - Path to the rights-protected content.
        Returns:
        ERROR_NONE for success; ERROR_UNKNOWN for failure.
      • removeRights

        public int removeRights(Uri uri)
        Removes the rights associated with the given rights-protected content.
        Parameters:
        uri - URI for the rights-protected content.
        Returns:
        ERROR_NONE for success; ERROR_UNKNOWN for failure.
      • removeAllRights

        public int removeAllRights()
        Removes all the rights information of every DRM plug-in (agent) associated with the DRM framework. Will be used during a master reset.
        Returns:
        ERROR_NONE for success; ERROR_UNKNOWN for failure.
      • openConvertSession

        public int openConvertSession(String mimeType)
        Initiates a new conversion session. An application must initiate a conversion session with this method each time it downloads a rights-protected file that needs to be converted.

        This method applies only to forward-locking (copy protection) DRM schemes.

        Parameters:
        mimeType - MIME type of the input data packet.
        Returns:
        A convert ID that is used used to maintain the conversion session.
      • convertData

        public DrmConvertedStatus convertData(int convertId,
                                     byte[] inputData)
        Converts the input data (content) that is part of a rights-protected file. The converted data and status is returned in a DrmConvertedStatus object. This method should be called each time there is a new block of data received by the application.
        Parameters:
        convertId - Handle for the conversion session.
        inputData - Input data that needs to be converted.
        Returns:
        A DrmConvertedStatus object that contains the status of the data conversion, the converted data, and offset for the header and body signature. An application can ignore the offset because it is only relevant to the closeConvertSession() method.
      • closeConvertSession

        public DrmConvertedStatus closeConvertSession(int convertId)
        Informs the DRM plug-in (agent) that there is no more data to convert or that an error has occurred. Upon successful conversion of the data, the DRM agent will provide an offset value indicating where the header and body signature should be added. Appending the signature is necessary to protect the integrity of the converted file.
        Parameters:
        convertId - Handle for the conversion session.
        Returns:
        A DrmConvertedStatus object that contains the status of the data conversion, the converted data, and the offset for the header and body signature.


Content

Android Reference

Java basics

Java Enterprise Edition (EE)

Java Standard Edition (SE)

SQL

HTML

PHP

CSS

Java Script

MYSQL

JQUERY

VBS

REGEX

C

C++

C#

Design patterns

RFC (standard status)

RFC (proposed standard status)

RFC (draft standard status)

RFC (informational status)

RFC (experimental status)

RFC (best current practice status)

RFC (historic status)

RFC (unknown status)

IT dictionary

License.
All information of this service is derived from the free sources and is provided solely in the form of quotations. This service provides information and interfaces solely for the familiarization (not ownership) and under the "as is" condition.
Copyright 2016 © ELTASK.COM. All rights reserved.
Site is optimized for mobile devices.
Downloads: 228 / . Delta: 0.05040 с