1/**
2 * Copyright (C) 2021 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.drm@1.4;
18
19import @1.2::Status;
20
21enum LogPriority : uint32_t {
22    UNKNOWN,
23    DEFAULT,
24    VERBOSE,
25    DEBUG,
26    INFO,
27    WARN,
28    ERROR,
29    FATAL,
30};
31
32/**
33 * Returned by getLogMessages to report error diagnostics to the
34 * app.
35 *
36 * The |message| field is for informational purposes only, and
37 * NOT meant to be parsed programmatically when handling errors.
38 * For programmatic error handling, please check the return |Status|
39 * of APIs instead.
40 */
41struct LogMessage {
42  /**
43   * Epoch time in milliseconds.
44   */
45  int64_t timeMs;
46  LogPriority priority;
47  string message;
48};
49
50enum Status : @1.2::Status {
51    /**
52     * queueSecureInput buffer called with 0 subsamples.
53     */
54    CANNOT_DECRYPT_ZERO_SUBSAMPLES,
55    /**
56     * An error happened within the crypto library used by the drm plugin.
57     */
58    CRYPTO_LIBRARY_ERROR,
59    /**
60     * Non-specific error reported by the device OEM subsystem.
61     */
62    GENERAL_OEM_ERROR,
63    /**
64     * Unexpected internal failure in the drm/crypto plugin.
65     */
66    GENERAL_PLUGIN_ERROR,
67    /**
68     * The init data parameter passed to getKeyRequest is empty or invalid.
69     */
70    INIT_DATA_INVALID,
71    /**
72     * Either the key was not loaded from the license before attempting the
73     * operation, or the key ID parameter provided by the app is incorrect.
74     */
75    KEY_NOT_LOADED,
76    /**
77     * The license response was empty, fields are missing or otherwise unable
78     * to be parsed.
79     */
80    LICENSE_PARSE_ERROR,
81    /**
82     * The operation (e.g. to renew or persist a license) is prohibited by the
83     * license policy.
84     */
85    LICENSE_POLICY_ERROR,
86    /**
87     * Failed to generate a release request because a field in the stored
88     * license is empty or malformed.
89     */
90    LICENSE_RELEASE_ERROR,
91    /**
92     * The license server detected an error in the license request.
93     */
94    LICENSE_REQUEST_REJECTED,
95    /**
96     * Failed to restore an offline license because a field is empty or
97     * malformed.
98     */
99    LICENSE_RESTORE_ERROR,
100    /**
101     * License is in an invalid state for the attempted operation.
102     */
103    LICENSE_STATE_ERROR,
104    /**
105     * Certificate is malformed or is of the wrong type.
106     */
107    MALFORMED_CERTIFICATE,
108    /**
109     * Failure in the media framework.
110     */
111    MEDIA_FRAMEWORK_ERROR,
112    /**
113     * Certificate has not been set.
114     */
115    MISSING_CERTIFICATE,
116    /**
117     * There was an error loading the provisioned certificate.
118     */
119    PROVISIONING_CERTIFICATE_ERROR,
120    /**
121     * Required steps where not performed before provisioning was attempted.
122     */
123    PROVISIONING_CONFIGURATION_ERROR,
124    /**
125     * The provisioning response was empty, fields are missing or otherwise
126     * unable to be parsed.
127     */
128    PROVISIONING_PARSE_ERROR,
129    /**
130     * The provisioning server detected an error in the provisioning request.
131     */
132    PROVISIONING_REQUEST_REJECTED,
133    /**
134     * Provisioning failed in a way that is likely to succeed on a subsequent
135     * attempt.
136     */
137    RETRYABLE_PROVISIONING_ERROR,
138    /**
139     * Failed to generate a secure stop request because a field in the stored
140     * license is empty or malformed.
141     */
142    SECURE_STOP_RELEASE_ERROR,
143    /**
144     * The plugin was unable to read data from the filesystem.
145     */
146    STORAGE_READ_FAILURE,
147    /**
148     * The plugin was unable to write data to the filesystem.
149     */
150    STORAGE_WRITE_FAILURE,
151};
152