Home | History | Annotate | Download | only in drm
      1 /*
      2  * Copyright (C) 2010 The Android Open Source Project
      3  *
      4  * Licensed under the Apache License, Version 2.0 (the "License");
      5  * you may not use this file except in compliance with the License.
      6  * You may obtain a copy of the License at
      7  *
      8  *      http://www.apache.org/licenses/LICENSE-2.0
      9  *
     10  * Unless required by applicable law or agreed to in writing, software
     11  * distributed under the License is distributed on an "AS IS" BASIS,
     12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     13  * See the License for the specific language governing permissions and
     14  * limitations under the License.
     15  */
     16 
     17 package android.drm;
     18 
     19 /**
     20  * An entity class that wraps the result of communication between a device and an online DRM
     21  * server. Specifically, when the {@link DrmManagerClient#processDrmInfo processDrmInfo()} method
     22  * is called, an instance of <code>DrmInfoStatus</code> is returned.
     23  *<p>
     24  * This class contains the {@link ProcessedData} object, which can be used to instantiate a
     25  * {@link DrmRights} object during license acquisition.
     26  *
     27  */
     28 public class DrmInfoStatus {
     29     // Should be in sync with DrmInfoStatus.cpp
     30     public static final int STATUS_OK = 1;
     31     public static final int STATUS_ERROR = 2;
     32 
     33     /**
     34      * The status of the communication.
     35      */
     36     public final int statusCode;
     37     /**
     38      * The type of DRM information processed.
     39      */
     40     public final int infoType;
     41     /**
     42      * The MIME type of the content.
     43      */
     44     public final String mimeType;
     45     /**
     46      * The processed data.
     47      */
     48     public final ProcessedData data;
     49 
     50     /**
     51      * Creates a <code>DrmInfoStatus</code> object with the specified parameters.
     52      *
     53      * @param _statusCode The status of the communication.
     54      * @param _infoType The type of the DRM information processed.
     55      * @param _data The processed data.
     56      * @param _mimeType The MIME type.
     57      */
     58     public DrmInfoStatus(int _statusCode, int _infoType, ProcessedData _data, String _mimeType) {
     59         statusCode = _statusCode;
     60         infoType = _infoType;
     61         data = _data;
     62         mimeType = _mimeType;
     63     }
     64 }
     65 
     66