DrmConvertedStatus.java revision d074e30ce44b9e33da43b67a4515b8986ca72b26
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
17package android.drm;
18
19/**
20 * This is an entity class which wraps the status of the conversion, the converted
21 * data/checksum data and the offset. Offset is going to be used in the case of close
22 * session where the agent will inform where the header and body signature should be added
23 *
24 * As a result of {@link DrmManagerClient#convertData(int, byte [])} and
25 * {@link DrmManagerClient#closeConvertSession(int)} an instance of DrmConvertedStatus
26 * would be returned.
27 *
28 */
29public class DrmConvertedStatus {
30    // Should be in sync with DrmConvertedStatus.cpp
31    public static final int STATUS_OK = 1;
32    public static final int STATUS_INPUTDATA_ERROR = 2;
33    public static final int STATUS_ERROR = 3;
34
35    public final int statusCode;
36    public final byte[] convertedData;
37    public final int offset;
38
39    /**
40     * constructor to create DrmConvertedStatus object with given parameters
41     *
42     * @param _statusCode Status of the conversion
43     * @param _convertedData Converted data/checksum data
44     * @param _offset Offset value
45     */
46    public DrmConvertedStatus(int _statusCode, byte[] _convertedData, int _offset) {
47        statusCode = _statusCode;
48        convertedData = _convertedData;
49        offset = _offset;
50    }
51}
52
53