blob: 88c0f40df0f120e53bcdb124fb32bd9329a7fd9a [file] [log] [blame]
aimitakeshi27ed8ad2010-07-29 10:12:27 +09001/*
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#ifndef __DRM_INFO_STATUS_H__
18#define __DRM_INFO_STATUS_H__
19
20#include "drm_framework_common.h"
21
22namespace android {
23
24/**
25 * This is an utility class which wraps the result of communication between device
26 * and online DRM server.
27 *
28 * As a result of DrmManagerClient::processDrmInfo(const DrmInfo*) an instance of
29 * DrmInfoStatus would be returned. This class holds DrmBuffer which could be
30 * used to instantiate DrmRights in license acquisition.
31 *
32 */
33class DrmInfoStatus {
34public:
35 // Should be in sync with DrmInfoStatus.java
36 static const int STATUS_OK = 1;
37 static const int STATUS_ERROR = 2;
38
39public:
40 /**
41 * Constructor for DrmInfoStatus
42 *
43 * @param[in] _statusCode Status of the communication
Takeshi Aimie943f842010-10-08 23:05:49 +090044 * @param[in] _infoType Type of the DRM information processed
aimitakeshi27ed8ad2010-07-29 10:12:27 +090045 * @param[in] _drmBuffer Rights information
46 * @param[in] _mimeType MIME type
47 */
Takeshi Aimie943f842010-10-08 23:05:49 +090048 DrmInfoStatus(int _statusCode, int _infoType, const DrmBuffer* _drmBuffer, const String8& _mimeType);
aimitakeshi27ed8ad2010-07-29 10:12:27 +090049
50 /**
51 * Destructor for DrmInfoStatus
52 */
53 virtual ~DrmInfoStatus() {
54
55 }
56
57public:
58 int statusCode;
Takeshi Aimie943f842010-10-08 23:05:49 +090059 int infoType;
aimitakeshi27ed8ad2010-07-29 10:12:27 +090060 const DrmBuffer* drmBuffer;
61 String8 mimeType;
62};
63
64};
65
66#endif /* __DRM_INFO_STATUS_H__ */
67