• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 converted data, conversion status, and the
21  * offset for appending the header and body signature to the converted data. An instance of this
22  * class is returned by the {@link DrmManagerClient#convertData convertData()} and
23  * {@link DrmManagerClient#closeConvertSession closeConvertSession()} methods. The offset is provided only when a
24  * conversion session is closed by calling {@link DrmManagerClient#closeConvertSession closeConvertSession()}.
25  *
26  */
27 public class DrmConvertedStatus {
28     // Should be in sync with DrmConvertedStatus.cpp
29     public static final int STATUS_OK = 1;
30     public static final int STATUS_INPUTDATA_ERROR = 2;
31     public static final int STATUS_ERROR = 3;
32 
33     /** Status code for the conversion.*/
34     public final int statusCode;
35     /** Converted data.*/
36     public final byte[] convertedData;
37     /** Offset value for the body and header signature.*/
38     public final int offset;
39 
40     /**
41      * Creates a <code>DrmConvertedStatus</code> object with the specified parameters.
42      *
43      * @param _statusCode Conversion status.
44      * @param _convertedData Converted data.
45      * @param _offset Offset value for appending the header and body signature.
46      */
DrmConvertedStatus(int _statusCode, byte[] _convertedData, int _offset)47     public DrmConvertedStatus(int _statusCode, byte[] _convertedData, int _offset) {
48         statusCode = _statusCode;
49         convertedData = _convertedData;
50         offset = _offset;
51     }
52 }
53 
54