summaryrefslogtreecommitdiff
path: root/cas/1.0/types.hal
blob: 7337f0014e40c9d218cb02060fd802db2d1096d0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
/**
 * Copyright (C) 2017 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package android.hardware.cas@1.0;

enum Status : uint32_t {
    /**
     * The CAS plugin must return OK when an operation completes without any
     * errors.
     */
    OK,

    /**
     * The CAS plugin must return ERROR_CAS_NO_LICENSE, when descrambling is
     * attempted and no license keys have been provided.
     */
    ERROR_CAS_NO_LICENSE,

    /**
     * ERROR_CAS_LICENSE_EXPIRED must be returned when an attempt is made
     * to use a license and the keys in that license have expired.
     */
    ERROR_CAS_LICENSE_EXPIRED,

    /**
     * The CAS plugin must return ERROR_CAS_SESSION_NOT_OPENED when an
     * attempt is made to use a session that has not been opened.
     */
    ERROR_CAS_SESSION_NOT_OPENED,

    /**
     * The CAS plugin must return ERROR_CAS_CANNOT_HANDLE when an unsupported
     * data format or operation is attempted.
     */
    ERROR_CAS_CANNOT_HANDLE,

    /**
     * ERROR_CAS_INVALID_STATE must be returned when the device is in a state
     * where it is not able to perform descrambling.
     */
    ERROR_CAS_INVALID_STATE,

    /**
     * The CAS plugin must return BAD_VALUE whenever an illegal parameter is
     * passed to one of the interface functions.
     */
    BAD_VALUE,

    /**
     * The CAS plugin must return ERROR_CAS_NOT_PROVISIONED when the device
     * has not yet been provisioned.
     */
    ERROR_CAS_NOT_PROVISIONED,

    /**
     * ERROR_CAS_RESOURCE_BUSY must be returned when resources, such as CAS
     * sessions or secure buffers are not available to perform a requested
     * operation because they are already in use.
     */
    ERROR_CAS_RESOURCE_BUSY,

    /**
     * The CAS Plugin must return ERROR_CAS_INSUFFICIENT_OUTPUT_PROTECTION
     * when the output protection level enabled on the device is not
     * sufficient to meet the requirements in the license policy. HDCP is an
     * example of a form of output protection.
     */
    ERROR_CAS_INSUFFICIENT_OUTPUT_PROTECTION,

    /**
     * The CAS Plugin must return ERROR_CAS_TAMPER_DETECTED if an attempt to
     * tamper with the CAS system is detected.
     */
    ERROR_CAS_TAMPER_DETECTED,

    /**
     * The CAS Plugin must return ERROR_CAS_DEVICE_REVOKED if the response
     * indicates that the device has been revoked. Device revocation means
     * that the device is no longer permitted to play content.
     */
    ERROR_CAS_DEVICE_REVOKED,

    /**
     * The CAS plugin must return ERROR_CAS_DECRYPT_UNIT_NOT_INITIALIZED when
     * descrambling is failing because the session is not initialized properly.
     */
    ERROR_CAS_DECRYPT_UNIT_NOT_INITIALIZED,

    /**
     * The CAS Plugin must return ERROR_CAS_DECRYPT if the DescramblerPlugin's
     * descramble operation fails.
     */
    ERROR_CAS_DECRYPT,

    /**
     * ERROR_CAS_UNKNOWN must be returned when a fatal failure occurs and no
     * other defined error is appropriate.
     */
    ERROR_CAS_UNKNOWN,
};

typedef vec<uint8_t> HidlCasSessionId;
typedef vec<uint8_t> HidlCasData;

/**
 * Describes a CAS plugin with its system id and name.
 */
struct HidlCasPluginDescriptor {
    int32_t caSystemId;
    string name;
};