• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1/**
2 * Copyright (C) 2017 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.hardware.cas@1.0;
18
19enum Status : uint32_t {
20    /**
21     * The CAS plugin must return OK when an operation completes without any
22     * errors.
23     */
24    OK,
25
26    /**
27     * The CAS plugin must return ERROR_CAS_NO_LICENSE, when descrambling is
28     * attempted and no license keys have been provided.
29     */
30    ERROR_CAS_NO_LICENSE,
31
32    /**
33     * ERROR_CAS_LICENSE_EXPIRED must be returned when an attempt is made
34     * to use a license and the keys in that license have expired.
35     */
36    ERROR_CAS_LICENSE_EXPIRED,
37
38    /**
39     * The CAS plugin must return ERROR_CAS_SESSION_NOT_OPENED when an
40     * attempt is made to use a session that has not been opened.
41     */
42    ERROR_CAS_SESSION_NOT_OPENED,
43
44    /**
45     * The CAS plugin must return ERROR_CAS_CANNOT_HANDLE when an unsupported
46     * data format or operation is attempted.
47     */
48    ERROR_CAS_CANNOT_HANDLE,
49
50    /**
51     * ERROR_CAS_INVALID_STATE must be returned when the device is in a state
52     * where it is not able to perform descrambling.
53     */
54    ERROR_CAS_INVALID_STATE,
55
56    /**
57     * The CAS plugin must return BAD_VALUE whenever an illegal parameter is
58     * passed to one of the interface functions.
59     */
60    BAD_VALUE,
61
62    /**
63     * The CAS plugin must return ERROR_CAS_NOT_PROVISIONED when the device
64     * has not yet been provisioned.
65     */
66    ERROR_CAS_NOT_PROVISIONED,
67
68    /**
69     * ERROR_CAS_RESOURCE_BUSY must be returned when resources, such as CAS
70     * sessions or secure buffers are not available to perform a requested
71     * operation because they are already in use.
72     */
73    ERROR_CAS_RESOURCE_BUSY,
74
75    /**
76     * The CAS Plugin must return ERROR_CAS_INSUFFICIENT_OUTPUT_PROTECTION
77     * when the output protection level enabled on the device is not
78     * sufficient to meet the requirements in the license policy. HDCP is an
79     * example of a form of output protection.
80     */
81    ERROR_CAS_INSUFFICIENT_OUTPUT_PROTECTION,
82
83    /**
84     * The CAS Plugin must return ERROR_CAS_TAMPER_DETECTED if an attempt to
85     * tamper with the CAS system is detected.
86     */
87    ERROR_CAS_TAMPER_DETECTED,
88
89    /**
90     * The CAS Plugin must return ERROR_CAS_DEVICE_REVOKED if the response
91     * indicates that the device has been revoked. Device revocation means
92     * that the device is no longer permitted to play content.
93     */
94    ERROR_CAS_DEVICE_REVOKED,
95
96    /**
97     * The CAS plugin must return ERROR_CAS_DECRYPT_UNIT_NOT_INITIALIZED when
98     * descrambling is failing because the session is not initialized properly.
99     */
100    ERROR_CAS_DECRYPT_UNIT_NOT_INITIALIZED,
101
102    /**
103     * The CAS Plugin must return ERROR_CAS_DECRYPT if the DescramblerPlugin's
104     * descramble operation fails.
105     */
106    ERROR_CAS_DECRYPT,
107
108    /**
109     * ERROR_CAS_UNKNOWN must be returned when a fatal failure occurs and no
110     * other defined error is appropriate.
111     */
112    ERROR_CAS_UNKNOWN,
113};
114
115typedef vec<uint8_t> HidlCasSessionId;
116typedef vec<uint8_t> HidlCasData;
117
118/**
119 * Describes a CAS plugin with its system id and name.
120 */
121struct HidlCasPluginDescriptor {
122    int32_t caSystemId;
123    string name;
124};
125