1/*
2 * Copyright (C) 2018 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 [email protected];
18
19import @1.0::IDrmPluginListener;
20import @1.0::SessionId;
21
22/**
23 * IDrmPluginListener is a listener interface for Drm events sent from an
24 * IDrmPlugin instance.
25 */
26interface IDrmPluginListener extends @1.0::IDrmPluginListener {
27    /**
28     * Some device crypto hardware is incapable of retaining crypto
29     * session state across suspend and resume cycles. A
30     * SessionLostState event must be signaled when a session has
31     * become invalid for this reason. This event must not be used to
32     * indicate a failure in the crypto system. Closing the session
33     * and opening a new one must allow the application to resume
34     * normal use of the drm hal module.
35     *
36     * @param sessionId identifies the session that has been invalidated
37     */
38     oneway sendSessionLostState(SessionId sessionId);
39
40    /**
41     * Send a keys change event to the listener. The keys change event
42     * indicates the status of each key in the session. Keys can be
43     * indicated as being usable, expired, outputnotallowed or statuspending.
44     *
45     * This method only differs from @1.0 version by the addition of new
46     * KeyStatusType(s) in keyStatusList.
47     *
48     * @param sessionId identifies the session the event originated from
49     * @param keyStatusList indicates the status for each key ID in the
50     * session.
51     * @param hasNewUsableKey indicates if the event includes at least one
52     * key that has become usable.
53     */
54    oneway sendKeysChange_1_2(SessionId sessionId, vec<KeyStatus> keyStatusList,
55            bool hasNewUsableKey);
56
57};
58