xref: /aosp_15_r20/hardware/interfaces/drm/1.0/IDrmPlugin.hal (revision 4d7e907c777eeecc4c5bd7cf640a754fac206ff7)
1*4d7e907cSAndroid Build Coastguard Worker/**
2*4d7e907cSAndroid Build Coastguard Worker * Copyright (C) 2016 The Android Open Source Project
3*4d7e907cSAndroid Build Coastguard Worker *
4*4d7e907cSAndroid Build Coastguard Worker * Licensed under the Apache License, Version 2.0 (the "License");
5*4d7e907cSAndroid Build Coastguard Worker * you may not use this file except in compliance with the License.
6*4d7e907cSAndroid Build Coastguard Worker * You may obtain a copy of the License at
7*4d7e907cSAndroid Build Coastguard Worker *
8*4d7e907cSAndroid Build Coastguard Worker *      http://www.apache.org/licenses/LICENSE-2.0
9*4d7e907cSAndroid Build Coastguard Worker *
10*4d7e907cSAndroid Build Coastguard Worker * Unless required by applicable law or agreed to in writing, software
11*4d7e907cSAndroid Build Coastguard Worker * distributed under the License is distributed on an "AS IS" BASIS,
12*4d7e907cSAndroid Build Coastguard Worker * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13*4d7e907cSAndroid Build Coastguard Worker * See the License for the specific language governing permissions and
14*4d7e907cSAndroid Build Coastguard Worker * limitations under the License.
15*4d7e907cSAndroid Build Coastguard Worker */
16*4d7e907cSAndroid Build Coastguard Workerpackage [email protected];
17*4d7e907cSAndroid Build Coastguard Worker
18*4d7e907cSAndroid Build Coastguard Workerimport IDrmPluginListener;
19*4d7e907cSAndroid Build Coastguard Worker
20*4d7e907cSAndroid Build Coastguard Worker/**
21*4d7e907cSAndroid Build Coastguard Worker * Ref: frameworks/native/include/media/drm/DrmAPI.h:DrmPlugin
22*4d7e907cSAndroid Build Coastguard Worker *
23*4d7e907cSAndroid Build Coastguard Worker * IDrmPlugin is used to interact with a specific drm plugin that was
24*4d7e907cSAndroid Build Coastguard Worker * created by IDrm::createPlugin. A drm plugin provides methods for
25*4d7e907cSAndroid Build Coastguard Worker * obtaining drm keys that may be used by a codec to decrypt protected
26*4d7e907cSAndroid Build Coastguard Worker * video content.
27*4d7e907cSAndroid Build Coastguard Worker */
28*4d7e907cSAndroid Build Coastguard Workerinterface IDrmPlugin {
29*4d7e907cSAndroid Build Coastguard Worker
30*4d7e907cSAndroid Build Coastguard Worker    /**
31*4d7e907cSAndroid Build Coastguard Worker     * Open a new session with the DrmPlugin object. A session ID is returned
32*4d7e907cSAndroid Build Coastguard Worker     * in the sessionId parameter.
33*4d7e907cSAndroid Build Coastguard Worker     * @return status the status of the call. The status must be OK or one of
34*4d7e907cSAndroid Build Coastguard Worker     * the following errors: ERROR_DRM_NOT_PROVISIONED if the device requires
35*4d7e907cSAndroid Build Coastguard Worker     * provisioning before it can open a session, ERROR_DRM_RESOURCE_BUSY if
36*4d7e907cSAndroid Build Coastguard Worker     * there are insufficent resources available to open a session,
37*4d7e907cSAndroid Build Coastguard Worker     * ERROR_DRM_CANNOT_HANDLE, if openSession is not supported at the time of
38*4d7e907cSAndroid Build Coastguard Worker     * the call or ERROR_DRM_INVALID_STATE if the HAL is in a state where a
39*4d7e907cSAndroid Build Coastguard Worker     * session cannot be opened.
40*4d7e907cSAndroid Build Coastguard Worker     * @return sessionId the session ID for the newly opened session
41*4d7e907cSAndroid Build Coastguard Worker     */
42*4d7e907cSAndroid Build Coastguard Worker    openSession() generates (Status status, SessionId sessionId);
43*4d7e907cSAndroid Build Coastguard Worker
44*4d7e907cSAndroid Build Coastguard Worker    /**
45*4d7e907cSAndroid Build Coastguard Worker     * Close a session on the DrmPlugin object
46*4d7e907cSAndroid Build Coastguard Worker     *
47*4d7e907cSAndroid Build Coastguard Worker     * @param sessionId the session id the call applies to
48*4d7e907cSAndroid Build Coastguard Worker     * @return status the status of the call.  The status must be OK or one of
49*4d7e907cSAndroid Build Coastguard Worker     * the following errors: ERROR_DRM_SESSION_NOT_OPENED if the session is not
50*4d7e907cSAndroid Build Coastguard Worker     * opened, BAD_VALUE if the sessionId is invalid or ERROR_DRM_INVALID_STATE
51*4d7e907cSAndroid Build Coastguard Worker     * if the HAL is in a state where the session cannot be closed.
52*4d7e907cSAndroid Build Coastguard Worker     */
53*4d7e907cSAndroid Build Coastguard Worker    closeSession(SessionId sessionId) generates (Status status);
54*4d7e907cSAndroid Build Coastguard Worker
55*4d7e907cSAndroid Build Coastguard Worker    /**
56*4d7e907cSAndroid Build Coastguard Worker     * A key request/response exchange occurs between the app and a License
57*4d7e907cSAndroid Build Coastguard Worker     * Server to obtain the keys required to decrypt the content.
58*4d7e907cSAndroid Build Coastguard Worker     * getKeyRequest() is used to obtain an opaque key request blob that is
59*4d7e907cSAndroid Build Coastguard Worker     * delivered to the license server.
60*4d7e907cSAndroid Build Coastguard Worker     *
61*4d7e907cSAndroid Build Coastguard Worker     * @param scope may be a sessionId or a keySetId, depending on the
62*4d7e907cSAndroid Build Coastguard Worker     * specified keyType. When the keyType is OFFLINE or STREAMING,
63*4d7e907cSAndroid Build Coastguard Worker     * scope should be set to the sessionId the keys will be provided to.
64*4d7e907cSAndroid Build Coastguard Worker     * When the keyType is RELEASE, scope should be set to the keySetId
65*4d7e907cSAndroid Build Coastguard Worker     * of the keys being released.
66*4d7e907cSAndroid Build Coastguard Worker     * @param initData container-specific data, its meaning is interpreted
67*4d7e907cSAndroid Build Coastguard Worker     * based on the mime type provided in the mimeType parameter. It could
68*4d7e907cSAndroid Build Coastguard Worker     * contain, for example, the content ID, key ID or other data obtained
69*4d7e907cSAndroid Build Coastguard Worker     * from the content metadata that is required to generate the key request.
70*4d7e907cSAndroid Build Coastguard Worker     * initData may be empty when keyType is RELEASE.
71*4d7e907cSAndroid Build Coastguard Worker     * @param mimeType identifies the mime type of the content
72*4d7e907cSAndroid Build Coastguard Worker     * @param keyType specifies if the keys are to be used for streaming,
73*4d7e907cSAndroid Build Coastguard Worker     * offline or a release
74*4d7e907cSAndroid Build Coastguard Worker     * @param optionalParameters included in the key request message to
75*4d7e907cSAndroid Build Coastguard Worker     * allow a client application to provide additional message parameters to
76*4d7e907cSAndroid Build Coastguard Worker     * the server.
77*4d7e907cSAndroid Build Coastguard Worker     *
78*4d7e907cSAndroid Build Coastguard Worker     * @return status the status of the call.  The status must be OK or one of
79*4d7e907cSAndroid Build Coastguard Worker     * the following errors: ERROR_DRM_SESSION_NOT_OPENED if the session is not
80*4d7e907cSAndroid Build Coastguard Worker     * opened, ERROR_DRM_NOT_PROVISIONED if the device requires provisioning
81*4d7e907cSAndroid Build Coastguard Worker     * before it can generate a key request, ERROR_DRM_CANNOT_HANDLE if
82*4d7e907cSAndroid Build Coastguard Worker     * getKeyRequest is not supported at the time of the call, BAD_VALUE if any
83*4d7e907cSAndroid Build Coastguard Worker     * parameters are invalid or ERROR_DRM_INVALID_STATE if the HAL is in a state
84*4d7e907cSAndroid Build Coastguard Worker     * where a key request cannot be generated.
85*4d7e907cSAndroid Build Coastguard Worker     * @return request if successful, the opaque key request blob is returned
86*4d7e907cSAndroid Build Coastguard Worker     * @return requestType indicates type information about the returned
87*4d7e907cSAndroid Build Coastguard Worker     * request. The type may be one of INITIAL, RENEWAL or RELEASE. An
88*4d7e907cSAndroid Build Coastguard Worker     * INITIAL request is the first key request for a license. RENEWAL is a
89*4d7e907cSAndroid Build Coastguard Worker     * subsequent key request used to refresh the keys in a license. RELEASE
90*4d7e907cSAndroid Build Coastguard Worker     * corresponds to a keyType of RELEASE, which indicates keys are being
91*4d7e907cSAndroid Build Coastguard Worker     * released.
92*4d7e907cSAndroid Build Coastguard Worker     * @return defaultUrl the URL that the request may be sent to, if
93*4d7e907cSAndroid Build Coastguard Worker     * provided by the drm HAL. The app may choose to override this
94*4d7e907cSAndroid Build Coastguard Worker     * URL.
95*4d7e907cSAndroid Build Coastguard Worker     */
96*4d7e907cSAndroid Build Coastguard Worker    getKeyRequest(vec<uint8_t> scope, vec<uint8_t> initData,
97*4d7e907cSAndroid Build Coastguard Worker            string mimeType, KeyType keyType, KeyedVector optionalParameters)
98*4d7e907cSAndroid Build Coastguard Worker        generates (Status status, vec<uint8_t> request,
99*4d7e907cSAndroid Build Coastguard Worker                KeyRequestType requestType, string defaultUrl);
100*4d7e907cSAndroid Build Coastguard Worker
101*4d7e907cSAndroid Build Coastguard Worker    /**
102*4d7e907cSAndroid Build Coastguard Worker     * After a key response is received by the app, it is provided to the
103*4d7e907cSAndroid Build Coastguard Worker     * Drm plugin using provideKeyResponse.
104*4d7e907cSAndroid Build Coastguard Worker     *
105*4d7e907cSAndroid Build Coastguard Worker     * @param scope may be a sessionId or a keySetId depending on the type
106*4d7e907cSAndroid Build Coastguard Worker     * of the response. Scope should be set to the sessionId when the response
107*4d7e907cSAndroid Build Coastguard Worker     * is for either streaming or offline key requests. Scope should be set to
108*4d7e907cSAndroid Build Coastguard Worker     * the keySetId when the response is for a release request.
109*4d7e907cSAndroid Build Coastguard Worker     * @param response the response from the key server that is being
110*4d7e907cSAndroid Build Coastguard Worker     * provided to the drm HAL.
111*4d7e907cSAndroid Build Coastguard Worker     *
112*4d7e907cSAndroid Build Coastguard Worker     * @return status the status of the call.  The status must be OK or one of
113*4d7e907cSAndroid Build Coastguard Worker     * the following errors: ERROR_DRM_SESSION_NOT_OPENED if the session is not
114*4d7e907cSAndroid Build Coastguard Worker     * opened, ERROR_DRM_NOT_PROVISIONED if the device requires provisioning
115*4d7e907cSAndroid Build Coastguard Worker     * before it can handle the key response, ERROR_DRM_DEVICE_REVOKED if the
116*4d7e907cSAndroid Build Coastguard Worker     * device has been disabled by the license policy, ERROR_DRM_CANNOT_HANDLE
117*4d7e907cSAndroid Build Coastguard Worker     * if provideKeyResponse is not supported at the time of the call, BAD_VALUE
118*4d7e907cSAndroid Build Coastguard Worker     * if any parameters are invalid or ERROR_DRM_INVALID_STATE if the HAL is
119*4d7e907cSAndroid Build Coastguard Worker     * in a state where a key response cannot be handled.
120*4d7e907cSAndroid Build Coastguard Worker     * @return keySetId when the response is for an offline key request, a
121*4d7e907cSAndroid Build Coastguard Worker     * keySetId is returned in the keySetId vector parameter that can be used
122*4d7e907cSAndroid Build Coastguard Worker     * to later restore the keys to a new session with the method restoreKeys.
123*4d7e907cSAndroid Build Coastguard Worker     * When the response is for a streaming or release request, no keySetId is
124*4d7e907cSAndroid Build Coastguard Worker     * returned.
125*4d7e907cSAndroid Build Coastguard Worker     */
126*4d7e907cSAndroid Build Coastguard Worker    provideKeyResponse(vec<uint8_t> scope, vec<uint8_t> response)
127*4d7e907cSAndroid Build Coastguard Worker        generates (Status status, vec<uint8_t> keySetId);
128*4d7e907cSAndroid Build Coastguard Worker
129*4d7e907cSAndroid Build Coastguard Worker    /**
130*4d7e907cSAndroid Build Coastguard Worker     * Remove the current keys from a session
131*4d7e907cSAndroid Build Coastguard Worker     *
132*4d7e907cSAndroid Build Coastguard Worker     * @param sessionId the session id the call applies to
133*4d7e907cSAndroid Build Coastguard Worker     * @return status the status of the call.  The status must be OK or one of
134*4d7e907cSAndroid Build Coastguard Worker     * the following errors: ERROR_DRM_SESSION_NOT_OPENED if the session is not
135*4d7e907cSAndroid Build Coastguard Worker     * opened, BAD_VALUE if the sessionId is invalid or ERROR_DRM_INVALID_STATE
136*4d7e907cSAndroid Build Coastguard Worker     * if the HAL is in a state where the keys cannot be removed.
137*4d7e907cSAndroid Build Coastguard Worker     */
138*4d7e907cSAndroid Build Coastguard Worker    removeKeys(SessionId sessionId) generates (Status status);
139*4d7e907cSAndroid Build Coastguard Worker
140*4d7e907cSAndroid Build Coastguard Worker    /**
141*4d7e907cSAndroid Build Coastguard Worker     * Restore persisted offline keys into a new session
142*4d7e907cSAndroid Build Coastguard Worker     *
143*4d7e907cSAndroid Build Coastguard Worker     * @param sessionId the session id the call applies to
144*4d7e907cSAndroid Build Coastguard Worker     * @param keySetId identifies the keys to load, obtained from a prior
145*4d7e907cSAndroid Build Coastguard Worker     * call to provideKeyResponse().
146*4d7e907cSAndroid Build Coastguard Worker     * @return status the status of the call. The status must be OK or one of
147*4d7e907cSAndroid Build Coastguard Worker     * the following errors: ERROR_DRM_SESSION_NOT_OPENED if the session is not
148*4d7e907cSAndroid Build Coastguard Worker     * opened, BAD_VALUE if any parameters are invalid or ERROR_DRM_INVALID_STATE
149*4d7e907cSAndroid Build Coastguard Worker     * if the HAL is in a state where keys cannot be restored.
150*4d7e907cSAndroid Build Coastguard Worker     */
151*4d7e907cSAndroid Build Coastguard Worker    restoreKeys(SessionId sessionId,
152*4d7e907cSAndroid Build Coastguard Worker            vec<uint8_t> keySetId) generates (Status status);
153*4d7e907cSAndroid Build Coastguard Worker
154*4d7e907cSAndroid Build Coastguard Worker    /**
155*4d7e907cSAndroid Build Coastguard Worker     * Request an informative description of the license for the session. The
156*4d7e907cSAndroid Build Coastguard Worker     * status is in the form of {name, value} pairs. Since DRM license policies
157*4d7e907cSAndroid Build Coastguard Worker     * vary by vendor, the specific status field names are determined by each
158*4d7e907cSAndroid Build Coastguard Worker     * DRM vendor. Refer to your DRM provider documentation for definitions of
159*4d7e907cSAndroid Build Coastguard Worker     * the field names for a particular drm scheme.
160*4d7e907cSAndroid Build Coastguard Worker     *
161*4d7e907cSAndroid Build Coastguard Worker     * @param sessionId the session id the call applies to
162*4d7e907cSAndroid Build Coastguard Worker     * @return status the status of the call. The status must be OK or one of
163*4d7e907cSAndroid Build Coastguard Worker     * the following errors: ERROR_DRM_SESSION_NOT_OPENED if the session is not
164*4d7e907cSAndroid Build Coastguard Worker     * opened, BAD_VALUE if the sessionId is invalid or ERROR_DRM_INVALID_STATE
165*4d7e907cSAndroid Build Coastguard Worker     * if the HAL is in a state where key status cannot be queried.
166*4d7e907cSAndroid Build Coastguard Worker     * @return infoList a list of name value pairs describing the license
167*4d7e907cSAndroid Build Coastguard Worker     */
168*4d7e907cSAndroid Build Coastguard Worker    queryKeyStatus(SessionId sessionId)
169*4d7e907cSAndroid Build Coastguard Worker        generates (Status status, KeyedVector infoList);
170*4d7e907cSAndroid Build Coastguard Worker
171*4d7e907cSAndroid Build Coastguard Worker    /**
172*4d7e907cSAndroid Build Coastguard Worker     * A provision request/response exchange occurs between the app and a
173*4d7e907cSAndroid Build Coastguard Worker     * provisioning server to retrieve a device certificate. getProvisionRequest
174*4d7e907cSAndroid Build Coastguard Worker     * is used to obtain an opaque provisioning request blob that is delivered
175*4d7e907cSAndroid Build Coastguard Worker     * to the provisioning server.
176*4d7e907cSAndroid Build Coastguard Worker     *
177*4d7e907cSAndroid Build Coastguard Worker     * @param certificateType the type of certificate requested, e.g. "X.509"
178*4d7e907cSAndroid Build Coastguard Worker     * @param certificateAuthority identifies the certificate authority. A
179*4d7e907cSAndroid Build Coastguard Worker     * certificate authority (CA) is an entity which issues digital certificates
180*4d7e907cSAndroid Build Coastguard Worker     * for use by other parties. It is an example of a trusted third party.
181*4d7e907cSAndroid Build Coastguard Worker     * @return status the status of the call. The status must be OK or one of
182*4d7e907cSAndroid Build Coastguard Worker     * the following errors: ERROR_DRM_CANNOT_HANDLE if the drm scheme does not
183*4d7e907cSAndroid Build Coastguard Worker     * require provisioning or ERROR_DRM_INVALID_STATE if the HAL is in a state
184*4d7e907cSAndroid Build Coastguard Worker     * where the provision request cannot be generated.
185*4d7e907cSAndroid Build Coastguard Worker     * @return request if successful the opaque certificate request blob
186*4d7e907cSAndroid Build Coastguard Worker     * is returned
187*4d7e907cSAndroid Build Coastguard Worker     * @return defaultUrl URL that the provisioning request should be
188*4d7e907cSAndroid Build Coastguard Worker     * sent to, if known by the HAL implementation.  If the HAL implementation
189*4d7e907cSAndroid Build Coastguard Worker     * does not provide a defaultUrl, the returned string must be empty.
190*4d7e907cSAndroid Build Coastguard Worker     */
191*4d7e907cSAndroid Build Coastguard Worker    getProvisionRequest(string certificateType, string certificateAuthority)
192*4d7e907cSAndroid Build Coastguard Worker        generates (Status status, vec<uint8_t> request, string defaultUrl);
193*4d7e907cSAndroid Build Coastguard Worker
194*4d7e907cSAndroid Build Coastguard Worker    /**
195*4d7e907cSAndroid Build Coastguard Worker     * After a provision response is received by the app from a provisioning
196*4d7e907cSAndroid Build Coastguard Worker     * server, it is provided to the Drm HAL using provideProvisionResponse.
197*4d7e907cSAndroid Build Coastguard Worker     * The HAL implementation must receive the provision request and
198*4d7e907cSAndroid Build Coastguard Worker     * store the provisioned credentials.
199*4d7e907cSAndroid Build Coastguard Worker     *
200*4d7e907cSAndroid Build Coastguard Worker     * @param response the opaque provisioning response received by the
201*4d7e907cSAndroid Build Coastguard Worker     * app from a provisioning server.
202*4d7e907cSAndroid Build Coastguard Worker
203*4d7e907cSAndroid Build Coastguard Worker     * @return status the status of the call. The status must be OK or one of
204*4d7e907cSAndroid Build Coastguard Worker     * the following errors: ERROR_DRM_DEVICE_REVOKED if the device has been
205*4d7e907cSAndroid Build Coastguard Worker     * disabled by the license policy, BAD_VALUE if any parameters are invalid
206*4d7e907cSAndroid Build Coastguard Worker     * or ERROR_DRM_INVALID_STATE if the HAL is in a state where the provision
207*4d7e907cSAndroid Build Coastguard Worker     * response cannot be handled.
208*4d7e907cSAndroid Build Coastguard Worker     * @return certificate the public certificate resulting from the provisioning
209*4d7e907cSAndroid Build Coastguard Worker     * operation, if any. An empty vector indicates that no certificate was
210*4d7e907cSAndroid Build Coastguard Worker     * returned.
211*4d7e907cSAndroid Build Coastguard Worker     * @return wrappedKey an opaque object containing encrypted private key
212*4d7e907cSAndroid Build Coastguard Worker     * material to be used by signRSA when computing an RSA signature on a
213*4d7e907cSAndroid Build Coastguard Worker     * message, see the signRSA method.
214*4d7e907cSAndroid Build Coastguard Worker     */
215*4d7e907cSAndroid Build Coastguard Worker    provideProvisionResponse(vec<uint8_t> response) generates (Status status,
216*4d7e907cSAndroid Build Coastguard Worker            vec<uint8_t> certificate, vec<uint8_t> wrappedKey);
217*4d7e907cSAndroid Build Coastguard Worker
218*4d7e907cSAndroid Build Coastguard Worker    /**
219*4d7e907cSAndroid Build Coastguard Worker     * SecureStop is a way of enforcing the concurrent stream limit per
220*4d7e907cSAndroid Build Coastguard Worker     * subscriber. It can securely monitor the lifetime of sessions across
221*4d7e907cSAndroid Build Coastguard Worker     * device reboots by periodically persisting the session lifetime
222*4d7e907cSAndroid Build Coastguard Worker     * status in secure storage.
223*4d7e907cSAndroid Build Coastguard Worker     *
224*4d7e907cSAndroid Build Coastguard Worker     * A signed version of the sessionID is written to persistent storage on the
225*4d7e907cSAndroid Build Coastguard Worker     * device when each MediaCrypto object is created and periodically during
226*4d7e907cSAndroid Build Coastguard Worker     * playback. The sessionID is signed by the device private key to prevent
227*4d7e907cSAndroid Build Coastguard Worker     * tampering.
228*4d7e907cSAndroid Build Coastguard Worker     *
229*4d7e907cSAndroid Build Coastguard Worker     * When playback is completed the session is destroyed, and the secure
230*4d7e907cSAndroid Build Coastguard Worker     * stops are queried by the app. The app then delivers the secure stop
231*4d7e907cSAndroid Build Coastguard Worker     * message to a server which verifies the signature to confirm that the
232*4d7e907cSAndroid Build Coastguard Worker     * session and its keys have been removed from the device. The persisted
233*4d7e907cSAndroid Build Coastguard Worker     * record on the device is removed after receiving and verifying the
234*4d7e907cSAndroid Build Coastguard Worker     * signed response from the server.
235*4d7e907cSAndroid Build Coastguard Worker     */
236*4d7e907cSAndroid Build Coastguard Worker
237*4d7e907cSAndroid Build Coastguard Worker    /**
238*4d7e907cSAndroid Build Coastguard Worker     * Get all secure stops on the device
239*4d7e907cSAndroid Build Coastguard Worker     *
240*4d7e907cSAndroid Build Coastguard Worker     * @return status the status of the call. The status must be OK or
241*4d7e907cSAndroid Build Coastguard Worker     * ERROR_DRM_INVALID_STATE if the HAL is in a state where the secure stops
242*4d7e907cSAndroid Build Coastguard Worker     * cannot be returned.
243*4d7e907cSAndroid Build Coastguard Worker     * @return secureStops a list of the secure stop opaque objects
244*4d7e907cSAndroid Build Coastguard Worker     */
245*4d7e907cSAndroid Build Coastguard Worker    getSecureStops() generates
246*4d7e907cSAndroid Build Coastguard Worker        (Status status, vec<SecureStop> secureStops);
247*4d7e907cSAndroid Build Coastguard Worker
248*4d7e907cSAndroid Build Coastguard Worker    /**
249*4d7e907cSAndroid Build Coastguard Worker     * Get all secure stops by secure stop ID
250*4d7e907cSAndroid Build Coastguard Worker     *
251*4d7e907cSAndroid Build Coastguard Worker     * @param secureStopId the ID of the secure stop to return. The
252*4d7e907cSAndroid Build Coastguard Worker     * secure stop ID is delivered by the key server as part of the key
253*4d7e907cSAndroid Build Coastguard Worker     * response and must also be known by the app.
254*4d7e907cSAndroid Build Coastguard Worker     *
255*4d7e907cSAndroid Build Coastguard Worker     * @return status the status of the call. The status must be OK or one of
256*4d7e907cSAndroid Build Coastguard Worker     * the following errors: BAD_VALUE if the secureStopId is invalid or
257*4d7e907cSAndroid Build Coastguard Worker     * ERROR_DRM_INVALID_STATE if the HAL is in a state where the secure stop
258*4d7e907cSAndroid Build Coastguard Worker     * cannot be returned.
259*4d7e907cSAndroid Build Coastguard Worker     * @return secureStop the secure stop opaque object
260*4d7e907cSAndroid Build Coastguard Worker     */
261*4d7e907cSAndroid Build Coastguard Worker
262*4d7e907cSAndroid Build Coastguard Worker    getSecureStop(SecureStopId secureStopId)
263*4d7e907cSAndroid Build Coastguard Worker        generates (Status status, SecureStop secureStop);
264*4d7e907cSAndroid Build Coastguard Worker
265*4d7e907cSAndroid Build Coastguard Worker    /**
266*4d7e907cSAndroid Build Coastguard Worker     * Release all secure stops on the device
267*4d7e907cSAndroid Build Coastguard Worker     *
268*4d7e907cSAndroid Build Coastguard Worker     * @return status the status of the call. The status must be OK or
269*4d7e907cSAndroid Build Coastguard Worker     * ERROR_DRM_INVALID_STATE if the HAL is in a state where the secure
270*4d7e907cSAndroid Build Coastguard Worker     * stops cannot be released.
271*4d7e907cSAndroid Build Coastguard Worker     */
272*4d7e907cSAndroid Build Coastguard Worker    releaseAllSecureStops() generates (Status status);
273*4d7e907cSAndroid Build Coastguard Worker
274*4d7e907cSAndroid Build Coastguard Worker    /**
275*4d7e907cSAndroid Build Coastguard Worker     * Release a secure stop by secure stop ID
276*4d7e907cSAndroid Build Coastguard Worker     *
277*4d7e907cSAndroid Build Coastguard Worker     * @param secureStopId the ID of the secure stop to release. The
278*4d7e907cSAndroid Build Coastguard Worker     * secure stop ID is delivered by the key server as part of the key
279*4d7e907cSAndroid Build Coastguard Worker     * response and must also be known by the app.
280*4d7e907cSAndroid Build Coastguard Worker     *
281*4d7e907cSAndroid Build Coastguard Worker     * @return status the status of the call. The status must be OK or one of
282*4d7e907cSAndroid Build Coastguard Worker     * the following errors: BAD_VALUE if the secureStopId is invalid or
283*4d7e907cSAndroid Build Coastguard Worker     * ERROR_DRM_INVALID_STATE if the HAL is in a state where the secure stop
284*4d7e907cSAndroid Build Coastguard Worker     * cannot be released.
285*4d7e907cSAndroid Build Coastguard Worker     */
286*4d7e907cSAndroid Build Coastguard Worker    releaseSecureStop(vec<uint8_t> secureStopId) generates (Status status);
287*4d7e907cSAndroid Build Coastguard Worker
288*4d7e907cSAndroid Build Coastguard Worker    /**
289*4d7e907cSAndroid Build Coastguard Worker     * A drm scheme can have properties that are settable and readable
290*4d7e907cSAndroid Build Coastguard Worker     * by an app. There are a few forms of property access methods,
291*4d7e907cSAndroid Build Coastguard Worker     * depending on the data type of the property.
292*4d7e907cSAndroid Build Coastguard Worker     *
293*4d7e907cSAndroid Build Coastguard Worker     * Property values defined by the public API are:
294*4d7e907cSAndroid Build Coastguard Worker     *   "vendor" [string] identifies the maker of the drm scheme
295*4d7e907cSAndroid Build Coastguard Worker     *   "version" [string] identifies the version of the drm scheme
296*4d7e907cSAndroid Build Coastguard Worker     *   "description" [string] describes the drm scheme
297*4d7e907cSAndroid Build Coastguard Worker     *   'deviceUniqueId' [byte array] The device unique identifier is
298*4d7e907cSAndroid Build Coastguard Worker     *   established during device provisioning and provides a means of
299*4d7e907cSAndroid Build Coastguard Worker     *   uniquely identifying each device.
300*4d7e907cSAndroid Build Coastguard Worker     *
301*4d7e907cSAndroid Build Coastguard Worker     * Since drm scheme properties may vary, additional field names may be
302*4d7e907cSAndroid Build Coastguard Worker     * defined by each DRM vendor. Refer to your DRM provider documentation
303*4d7e907cSAndroid Build Coastguard Worker     * for definitions of its additional field names.
304*4d7e907cSAndroid Build Coastguard Worker     */
305*4d7e907cSAndroid Build Coastguard Worker
306*4d7e907cSAndroid Build Coastguard Worker    /**
307*4d7e907cSAndroid Build Coastguard Worker     * Read a string property value given the property name.
308*4d7e907cSAndroid Build Coastguard Worker     *
309*4d7e907cSAndroid Build Coastguard Worker     * @param propertyName the name of the property
310*4d7e907cSAndroid Build Coastguard Worker     * @return status the status of the call. The status must be OK or one of
311*4d7e907cSAndroid Build Coastguard Worker     * the following errors: BAD_VALUE if the property name is invalid,
312*4d7e907cSAndroid Build Coastguard Worker     * ERROR_DRM_CANNOT_HANDLE if the property is not supported, or
313*4d7e907cSAndroid Build Coastguard Worker     * ERROR_DRM_INVALID_STATE if the HAL is in a state where the property
314*4d7e907cSAndroid Build Coastguard Worker     * cannot be obtained.
315*4d7e907cSAndroid Build Coastguard Worker     * @return value the property value string
316*4d7e907cSAndroid Build Coastguard Worker     */
317*4d7e907cSAndroid Build Coastguard Worker    getPropertyString(string propertyName)
318*4d7e907cSAndroid Build Coastguard Worker        generates (Status status, string value);
319*4d7e907cSAndroid Build Coastguard Worker
320*4d7e907cSAndroid Build Coastguard Worker    /**
321*4d7e907cSAndroid Build Coastguard Worker     * Read a byte array property value given the property name.
322*4d7e907cSAndroid Build Coastguard Worker     *
323*4d7e907cSAndroid Build Coastguard Worker     * @param propertyName the name of the property
324*4d7e907cSAndroid Build Coastguard Worker     * @return status the status of the call. The status must be OK or one of
325*4d7e907cSAndroid Build Coastguard Worker     * the following errors: BAD_VALUE if the property name is invalid,
326*4d7e907cSAndroid Build Coastguard Worker     * ERROR_DRM_CANNOT_HANDLE if the property is not supported, or
327*4d7e907cSAndroid Build Coastguard Worker     * ERROR_DRM_INVALID_STATE if the HAL is in a state where the property
328*4d7e907cSAndroid Build Coastguard Worker     * cannot be obtained.
329*4d7e907cSAndroid Build Coastguard Worker     * @return value the property value byte array
330*4d7e907cSAndroid Build Coastguard Worker     */
331*4d7e907cSAndroid Build Coastguard Worker    getPropertyByteArray(string propertyName)
332*4d7e907cSAndroid Build Coastguard Worker        generates (Status status, vec<uint8_t> value);
333*4d7e907cSAndroid Build Coastguard Worker
334*4d7e907cSAndroid Build Coastguard Worker    /**
335*4d7e907cSAndroid Build Coastguard Worker     * Write a property string value given the property name
336*4d7e907cSAndroid Build Coastguard Worker     *
337*4d7e907cSAndroid Build Coastguard Worker     * @param propertyName the name of the property
338*4d7e907cSAndroid Build Coastguard Worker     * @param value the value to write
339*4d7e907cSAndroid Build Coastguard Worker     * @return status the status of the call. The status must be OK or one of
340*4d7e907cSAndroid Build Coastguard Worker     * the following errors: BAD_VALUE if the property name is invalid,
341*4d7e907cSAndroid Build Coastguard Worker     * ERROR_DRM_CANNOT_HANDLE if the property is not supported, or
342*4d7e907cSAndroid Build Coastguard Worker     * ERROR_DRM_INVALID_STATE if the HAL is in a state where the property
343*4d7e907cSAndroid Build Coastguard Worker     * cannot be set.
344*4d7e907cSAndroid Build Coastguard Worker     */
345*4d7e907cSAndroid Build Coastguard Worker    setPropertyString(string propertyName, string value)
346*4d7e907cSAndroid Build Coastguard Worker        generates (Status status);
347*4d7e907cSAndroid Build Coastguard Worker
348*4d7e907cSAndroid Build Coastguard Worker    /**
349*4d7e907cSAndroid Build Coastguard Worker     * Write a property byte array value given the property name
350*4d7e907cSAndroid Build Coastguard Worker     *
351*4d7e907cSAndroid Build Coastguard Worker     * @param propertyName the name of the property
352*4d7e907cSAndroid Build Coastguard Worker     * @param value the value to write
353*4d7e907cSAndroid Build Coastguard Worker     * @return status the status of the call. The status must be OK or one of
354*4d7e907cSAndroid Build Coastguard Worker     * the following errors: BAD_VALUE if the property name is invalid,
355*4d7e907cSAndroid Build Coastguard Worker     * ERROR_DRM_CANNOT_HANDLE if the property is not supported, or
356*4d7e907cSAndroid Build Coastguard Worker     * ERROR_DRM_INVALID_STATE if the HAL is in a state where the property
357*4d7e907cSAndroid Build Coastguard Worker     * cannot be set.
358*4d7e907cSAndroid Build Coastguard Worker     */
359*4d7e907cSAndroid Build Coastguard Worker    setPropertyByteArray(string propertyName, vec<uint8_t> value )
360*4d7e907cSAndroid Build Coastguard Worker        generates (Status status);
361*4d7e907cSAndroid Build Coastguard Worker
362*4d7e907cSAndroid Build Coastguard Worker    /**
363*4d7e907cSAndroid Build Coastguard Worker     * The following methods implement operations on a CryptoSession to support
364*4d7e907cSAndroid Build Coastguard Worker     * encrypt, decrypt, sign verify operations on operator-provided
365*4d7e907cSAndroid Build Coastguard Worker     * session keys.
366*4d7e907cSAndroid Build Coastguard Worker     */
367*4d7e907cSAndroid Build Coastguard Worker
368*4d7e907cSAndroid Build Coastguard Worker    /**
369*4d7e907cSAndroid Build Coastguard Worker     * Set the cipher algorithm to be used for the specified session.
370*4d7e907cSAndroid Build Coastguard Worker     *
371*4d7e907cSAndroid Build Coastguard Worker     * @param sessionId the session id the call applies to
372*4d7e907cSAndroid Build Coastguard Worker     * @param algorithm the algorithm to use. The string conforms to JCA
373*4d7e907cSAndroid Build Coastguard Worker     * Standard Names for Cipher Transforms and is case insensitive. An
374*4d7e907cSAndroid Build Coastguard Worker     * example algorithm is "AES/CBC/PKCS5Padding".
375*4d7e907cSAndroid Build Coastguard Worker     * @return status the status of the call. The status must be OK or one of
376*4d7e907cSAndroid Build Coastguard Worker     * the following errors: ERROR_DRM_SESSION_NOT_OPENED if the session is not
377*4d7e907cSAndroid Build Coastguard Worker     * opened, BAD_VALUE if any parameters are invalid or ERROR_DRM_INVALID_STATE
378*4d7e907cSAndroid Build Coastguard Worker     * if the HAL is in a state where the algorithm cannot be set.
379*4d7e907cSAndroid Build Coastguard Worker     */
380*4d7e907cSAndroid Build Coastguard Worker    setCipherAlgorithm(SessionId sessionId, string algorithm)
381*4d7e907cSAndroid Build Coastguard Worker        generates (Status status);
382*4d7e907cSAndroid Build Coastguard Worker
383*4d7e907cSAndroid Build Coastguard Worker    /**
384*4d7e907cSAndroid Build Coastguard Worker     * Set the MAC algorithm to be used for computing hashes in a session.
385*4d7e907cSAndroid Build Coastguard Worker     *
386*4d7e907cSAndroid Build Coastguard Worker     * @param sessionId the session id the call applies to
387*4d7e907cSAndroid Build Coastguard Worker     * @param algorithm the algorithm to use. The string conforms to JCA
388*4d7e907cSAndroid Build Coastguard Worker     * Standard Names for Mac Algorithms and is case insensitive. An example MAC
389*4d7e907cSAndroid Build Coastguard Worker     * algorithm string is "HmacSHA256".
390*4d7e907cSAndroid Build Coastguard Worker     * @return status the status of the call. The status must be OK or one of the
391*4d7e907cSAndroid Build Coastguard Worker     * following errors: ERROR_DRM_SESSION_NOT_OPENED if the session is not
392*4d7e907cSAndroid Build Coastguard Worker     * opened, BAD_VALUE if any parameters are invalid or ERROR_DRM_INVALID_STATE
393*4d7e907cSAndroid Build Coastguard Worker     * if the HAL is in a state where the algorithm cannot be set.
394*4d7e907cSAndroid Build Coastguard Worker     */
395*4d7e907cSAndroid Build Coastguard Worker    setMacAlgorithm(SessionId sessionId, string algorithm)
396*4d7e907cSAndroid Build Coastguard Worker        generates (Status status);
397*4d7e907cSAndroid Build Coastguard Worker
398*4d7e907cSAndroid Build Coastguard Worker    /**
399*4d7e907cSAndroid Build Coastguard Worker     * Encrypt the provided input buffer with the cipher algorithm specified by
400*4d7e907cSAndroid Build Coastguard Worker     * setCipherAlgorithm and the key selected by keyId, and return the
401*4d7e907cSAndroid Build Coastguard Worker     * encrypted data.
402*4d7e907cSAndroid Build Coastguard Worker     *
403*4d7e907cSAndroid Build Coastguard Worker     * @param sessionId the session id the call applies to
404*4d7e907cSAndroid Build Coastguard Worker     * @param keyId the ID of the key to use for encryption
405*4d7e907cSAndroid Build Coastguard Worker     * @param input the input data to encrypt
406*4d7e907cSAndroid Build Coastguard Worker     * @param iv the initialization vector to use for encryption
407*4d7e907cSAndroid Build Coastguard Worker     * @return status the status of the call. The status must be OK or one of the
408*4d7e907cSAndroid Build Coastguard Worker     * following errors: ERROR_DRM_SESSION_NOT_OPENED if the session is not opened,
409*4d7e907cSAndroid Build Coastguard Worker     * BAD_VALUE if any parameters are invalid or ERROR_DRM_INVALID_STATE
410*4d7e907cSAndroid Build Coastguard Worker     * if the HAL is in a state where the encrypt operation cannot be performed.
411*4d7e907cSAndroid Build Coastguard Worker     * @return output the decrypted data
412*4d7e907cSAndroid Build Coastguard Worker     */
413*4d7e907cSAndroid Build Coastguard Worker    encrypt(SessionId sessionId, vec<uint8_t> keyId, vec<uint8_t> input,
414*4d7e907cSAndroid Build Coastguard Worker            vec<uint8_t> iv) generates (Status status, vec<uint8_t> output);
415*4d7e907cSAndroid Build Coastguard Worker
416*4d7e907cSAndroid Build Coastguard Worker    /**
417*4d7e907cSAndroid Build Coastguard Worker     * Decrypt the provided input buffer with the cipher algorithm
418*4d7e907cSAndroid Build Coastguard Worker     * specified by setCipherAlgorithm and the key selected by keyId,
419*4d7e907cSAndroid Build Coastguard Worker     * and return the decrypted data.
420*4d7e907cSAndroid Build Coastguard Worker     *
421*4d7e907cSAndroid Build Coastguard Worker     * @param sessionId the session id the call applies to
422*4d7e907cSAndroid Build Coastguard Worker     * @param keyId the ID of the key to use for decryption
423*4d7e907cSAndroid Build Coastguard Worker     * @param input the input data to decrypt
424*4d7e907cSAndroid Build Coastguard Worker     * @param iv the initialization vector to use for decryption
425*4d7e907cSAndroid Build Coastguard Worker     * @return status the status of the call. The status must be OK or one of
426*4d7e907cSAndroid Build Coastguard Worker     * the following errors: ERROR_DRM_SESSION_NOT_OPENED if the session is not
427*4d7e907cSAndroid Build Coastguard Worker     * opened, BAD_VALUE if any parameters are invalid or ERROR_DRM_INVALID_STATE
428*4d7e907cSAndroid Build Coastguard Worker     * if the HAL is in a state where the decrypt operation cannot be
429*4d7e907cSAndroid Build Coastguard Worker     * performed.
430*4d7e907cSAndroid Build Coastguard Worker     * @return output the decrypted data
431*4d7e907cSAndroid Build Coastguard Worker     */
432*4d7e907cSAndroid Build Coastguard Worker    decrypt(SessionId sessionId, vec<uint8_t> keyId, vec<uint8_t> input,
433*4d7e907cSAndroid Build Coastguard Worker            vec<uint8_t> iv) generates (Status status, vec<uint8_t> output);
434*4d7e907cSAndroid Build Coastguard Worker
435*4d7e907cSAndroid Build Coastguard Worker    /**
436*4d7e907cSAndroid Build Coastguard Worker     * Compute a signature over the provided message using the mac algorithm
437*4d7e907cSAndroid Build Coastguard Worker     * specified by setMacAlgorithm and the key selected by keyId and return
438*4d7e907cSAndroid Build Coastguard Worker     * the signature.
439*4d7e907cSAndroid Build Coastguard Worker     *
440*4d7e907cSAndroid Build Coastguard Worker     * @param sessionId the session id the call applies to
441*4d7e907cSAndroid Build Coastguard Worker     * @param keyId the ID of the key to use for decryption
442*4d7e907cSAndroid Build Coastguard Worker     * @param message the message to compute a signature over
443*4d7e907cSAndroid Build Coastguard Worker     * @return status the status of the call. The status must be OK or one of
444*4d7e907cSAndroid Build Coastguard Worker     * the following errors: ERROR_DRM_SESSION_NOT_OPENED if the session is not
445*4d7e907cSAndroid Build Coastguard Worker     * opened, BAD_VALUE if any parameters are invalid or ERROR_DRM_INVALID_STATE
446*4d7e907cSAndroid Build Coastguard Worker     * if the HAL is in a state where the sign operation cannot be
447*4d7e907cSAndroid Build Coastguard Worker     * performed.
448*4d7e907cSAndroid Build Coastguard Worker     * @return signature the computed signature
449*4d7e907cSAndroid Build Coastguard Worker     */
450*4d7e907cSAndroid Build Coastguard Worker    sign(SessionId sessionId, vec<uint8_t> keyId, vec<uint8_t> message)
451*4d7e907cSAndroid Build Coastguard Worker        generates (Status status, vec<uint8_t> signature);
452*4d7e907cSAndroid Build Coastguard Worker
453*4d7e907cSAndroid Build Coastguard Worker    /**
454*4d7e907cSAndroid Build Coastguard Worker     * Compute a hash of the provided message using the mac algorithm specified
455*4d7e907cSAndroid Build Coastguard Worker     * by setMacAlgorithm and the key selected by keyId, and compare with the
456*4d7e907cSAndroid Build Coastguard Worker     * expected result.
457*4d7e907cSAndroid Build Coastguard Worker     *
458*4d7e907cSAndroid Build Coastguard Worker     * @param sessionId the session id the call applies to
459*4d7e907cSAndroid Build Coastguard Worker     * @param keyId the ID of the key to use for decryption
460*4d7e907cSAndroid Build Coastguard Worker     * @param message the message to compute a hash of
461*4d7e907cSAndroid Build Coastguard Worker     * @param signature the signature to verify
462*4d7e907cSAndroid Build Coastguard Worker     * @return status the status of the call. The status must be OK or one of
463*4d7e907cSAndroid Build Coastguard Worker     * the following errors: ERROR_DRM_SESSION_NOT_OPENED if the session is not
464*4d7e907cSAndroid Build Coastguard Worker     * opened, BAD_VALUE if any parameters are invalid or ERROR_DRM_INVALID_STATE
465*4d7e907cSAndroid Build Coastguard Worker     * if the HAL is in a state where the verify operation cannot be
466*4d7e907cSAndroid Build Coastguard Worker     * performed.
467*4d7e907cSAndroid Build Coastguard Worker     * @return match true if the signature is verified positively,
468*4d7e907cSAndroid Build Coastguard Worker     * false otherwise.
469*4d7e907cSAndroid Build Coastguard Worker     */
470*4d7e907cSAndroid Build Coastguard Worker    verify(SessionId sessionId, vec<uint8_t> keyId, vec<uint8_t> message,
471*4d7e907cSAndroid Build Coastguard Worker            vec<uint8_t> signature) generates (Status status, bool match);
472*4d7e907cSAndroid Build Coastguard Worker
473*4d7e907cSAndroid Build Coastguard Worker    /**
474*4d7e907cSAndroid Build Coastguard Worker     * Compute an RSA signature on the provided message using the specified
475*4d7e907cSAndroid Build Coastguard Worker     * algorithm.
476*4d7e907cSAndroid Build Coastguard Worker     *
477*4d7e907cSAndroid Build Coastguard Worker     * @param sessionId the session id the call applies to
478*4d7e907cSAndroid Build Coastguard Worker     * @param algorithm the signing algorithm, such as "RSASSA-PSS-SHA1"
479*4d7e907cSAndroid Build Coastguard Worker     * or "PKCS1-BlockType1"
480*4d7e907cSAndroid Build Coastguard Worker     * @param message the message to compute the signature on
481*4d7e907cSAndroid Build Coastguard Worker     * @param wrappedKey the private key returned during provisioning as
482*4d7e907cSAndroid Build Coastguard Worker     * returned by provideProvisionResponse.
483*4d7e907cSAndroid Build Coastguard Worker     * @return status the status of the call. The status must be OK or one of
484*4d7e907cSAndroid Build Coastguard Worker     * the following errors: ERROR_DRM_SESSION_NOT_OPENED if the session is
485*4d7e907cSAndroid Build Coastguard Worker     * not opened, BAD_VALUE if any parameters are invalid or
486*4d7e907cSAndroid Build Coastguard Worker     * ERROR_DRM_INVALID_STATE if the HAL is in a state where the signRSA
487*4d7e907cSAndroid Build Coastguard Worker     * operation cannot be performed.
488*4d7e907cSAndroid Build Coastguard Worker     * @return signature the RSA signature computed over the message
489*4d7e907cSAndroid Build Coastguard Worker     */
490*4d7e907cSAndroid Build Coastguard Worker    signRSA(SessionId sessionId, string algorithm, vec<uint8_t> message,
491*4d7e907cSAndroid Build Coastguard Worker        vec<uint8_t> wrappedkey)
492*4d7e907cSAndroid Build Coastguard Worker        generates (Status status, vec<uint8_t> signature);
493*4d7e907cSAndroid Build Coastguard Worker
494*4d7e907cSAndroid Build Coastguard Worker    /**
495*4d7e907cSAndroid Build Coastguard Worker     * Plugins call the following methods to deliver events to the
496*4d7e907cSAndroid Build Coastguard Worker     * java app.
497*4d7e907cSAndroid Build Coastguard Worker     */
498*4d7e907cSAndroid Build Coastguard Worker
499*4d7e907cSAndroid Build Coastguard Worker    /**
500*4d7e907cSAndroid Build Coastguard Worker     * Set a listener for a drm session. This allows the drm HAL to
501*4d7e907cSAndroid Build Coastguard Worker     * make asynchronous calls back to the client of IDrm.
502*4d7e907cSAndroid Build Coastguard Worker     *
503*4d7e907cSAndroid Build Coastguard Worker     * @param listener instance of IDrmPluginListener to receive the events
504*4d7e907cSAndroid Build Coastguard Worker     */
505*4d7e907cSAndroid Build Coastguard Worker    setListener(IDrmPluginListener listener);
506*4d7e907cSAndroid Build Coastguard Worker
507*4d7e907cSAndroid Build Coastguard Worker    /**
508*4d7e907cSAndroid Build Coastguard Worker     * Legacy event sending method, it sends events of various types using a
509*4d7e907cSAndroid Build Coastguard Worker     * single overloaded set of parameters. This form is deprecated.
510*4d7e907cSAndroid Build Coastguard Worker     *
511*4d7e907cSAndroid Build Coastguard Worker     * @param eventType the type of the event
512*4d7e907cSAndroid Build Coastguard Worker     * @param sessionId identifies the session the event originated from
513*4d7e907cSAndroid Build Coastguard Worker     * @param data event-specific data blob
514*4d7e907cSAndroid Build Coastguard Worker     */
515*4d7e907cSAndroid Build Coastguard Worker    sendEvent(EventType eventType, SessionId sessionId, vec<uint8_t> data);
516*4d7e907cSAndroid Build Coastguard Worker
517*4d7e907cSAndroid Build Coastguard Worker    /**
518*4d7e907cSAndroid Build Coastguard Worker     * Send a license expiration update to the listener. The expiration
519*4d7e907cSAndroid Build Coastguard Worker     * update indicates how long the current license is valid before it
520*4d7e907cSAndroid Build Coastguard Worker     * needs to be renewed.
521*4d7e907cSAndroid Build Coastguard Worker     *
522*4d7e907cSAndroid Build Coastguard Worker     * @param sessionId identifies the session the event originated from
523*4d7e907cSAndroid Build Coastguard Worker     * @param expiryTimeInMS the time when the keys need to be renewed.
524*4d7e907cSAndroid Build Coastguard Worker     * The time is in milliseconds, relative to the Unix epoch. A time of 0
525*4d7e907cSAndroid Build Coastguard Worker     * indicates that the keys never expire.
526*4d7e907cSAndroid Build Coastguard Worker     */
527*4d7e907cSAndroid Build Coastguard Worker     sendExpirationUpdate(SessionId sessionId, int64_t expiryTimeInMS);
528*4d7e907cSAndroid Build Coastguard Worker
529*4d7e907cSAndroid Build Coastguard Worker    /**
530*4d7e907cSAndroid Build Coastguard Worker     * Send a keys change event to the listener. The keys change event
531*4d7e907cSAndroid Build Coastguard Worker     * indicates the status of each key in the session. Keys can be
532*4d7e907cSAndroid Build Coastguard Worker     * indicated as being usable, expired, outputnotallowed or statuspending.
533*4d7e907cSAndroid Build Coastguard Worker     *
534*4d7e907cSAndroid Build Coastguard Worker     * @param sessionId identifies the session the event originated from
535*4d7e907cSAndroid Build Coastguard Worker     * @param keyStatusList indicates the status for each key ID in the
536*4d7e907cSAndroid Build Coastguard Worker     * session.
537*4d7e907cSAndroid Build Coastguard Worker     * @param hasNewUsableKey indicates if the event includes at least one
538*4d7e907cSAndroid Build Coastguard Worker     * key that has become usable.
539*4d7e907cSAndroid Build Coastguard Worker     */
540*4d7e907cSAndroid Build Coastguard Worker    sendKeysChange(SessionId sessionId, vec<KeyStatus> keyStatusList,
541*4d7e907cSAndroid Build Coastguard Worker            bool hasNewUsableKey);
542*4d7e907cSAndroid Build Coastguard Worker};
543