blob: 0660a433f232b90c646258e379e193a8c47b67d3 [file] [log] [blame]
Jeff Tinker1637e002017-12-07 19:20:12 -08001/**
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 */
16package android.hardware.drm@1.1;
17
18import @1.0::IDrmPlugin;
19import @1.0::IDrmPluginListener;
20import @1.0::Status;
21import @1.1::HdcpLevel;
22import @1.1::SecurityLevel;
23
24/**
25 * IDrmPlugin is used to interact with a specific drm plugin that was created by
26 * IDrm::createPlugin. A drm plugin provides methods for obtaining drm keys that
27 * may be used by a codec to decrypt protected video content.
28 */
29interface IDrmPlugin extends @1.0::IDrmPlugin {
30 /**
31 * Return the currently negotiated and max supported HDCP levels.
32 *
33 * The current level is based on the display(s) the device is connected to.
34 * If multiple HDCP-capable displays are simultaneously connected to
35 * separate interfaces, this method returns the lowest negotiated HDCP level
36 * of all interfaces.
37 *
38 * The maximum HDCP level is the highest level that can potentially be
39 * negotiated. It is a constant for any device, i.e. it does not depend on
40 * downstream receiving devices that could be connected. For example, if
41 * the device has HDCP 1.x keys and is capable of negotiating HDCP 1.x, but
42 * does not have HDCP 2.x keys, then the maximum HDCP capability would be
43 * reported as 1.x. If multiple HDCP-capable interfaces are present, it
44 * indicates the highest of the maximum HDCP levels of all interfaces.
45 *
46 * This method should only be used for informational purposes, not for
47 * enforcing compliance with HDCP requirements. Trusted enforcement of HDCP
48 * policies must be handled by the DRM system.
49 *
50 * @return status the status of the call. The status must be OK or
51 * ERROR_DRM_INVALID_STATE if the HAL is in a state where the HDCP
52 * level cannot be queried.
53 * @return connectedLevel the lowest HDCP level for any connected
54 * displays
55 * @return maxLevel the highest HDCP level that can be supported
56 * by the device
57 */
58 getHdcpLevels() generates (Status status, HdcpLevel connectedLevel,
59 HdcpLevel maxLevel);
60
61 /**
62 * Return the current number of open sessions and the maximum number of
63 * sessions that may be opened simultaneosly among all DRM instances for the
64 * active DRM scheme.
65 *
66 * @return status the status of the call. The status must be OK or
67 * ERROR_DRM_INVALID_STATE if the HAL is in a state where number of
68 * sessions cannot be queried.
69 * @return currentSessions the number of currently opened sessions
70 * @return maxSessions the maximum number of sessions that the device
71 * can support
72 */
73 getNumberOfSessions() generates (Status status, uint32_t currentSessions,
74 uint32_t maxSessions);
75
76 /**
77 * Return the current security level of a session. A session has an initial
78 * security level determined by the robustness of the DRM system's
79 * implementation on the device.
80 *
81 * @param sessionId the session id the call applies to
82 * @return status the status of the call. The status must be OK or one of
83 * the following errors: ERROR_DRM_SESSION_NOT_OPENED if the
84 * session is not opened, BAD_VALUE if the sessionId is invalid or
85 * ERROR_DRM_INVALID_STATE if the HAL is in a state where the
86 * security level cannot be queried.
87 * @return level the current security level for the session
88 */
89 getSecurityLevel(vec<uint8_t> sessionId) generates(Status status,
90 SecurityLevel level);
91
92 /**
93 * Set the security level of a session. This can be useful if specific
94 * attributes of a lower security level are needed by an application, such
95 * as image manipulation or compositing which requires non-secure decoded
96 * frames. Reducing the security level may limit decryption to lower content
97 * resolutions, depending on the license policy.
98 *
99 * @param sessionId the session id the call applies to
100 * @param level the requested security level
101 * @return status the status of the call. The status must be OK or one of
102 * the following errors: ERROR_DRM_SESSION_NOT_OPENED if the session
103 * is not opened, BAD_VALUE if the sessionId or security level is
104 * invalid or ERROR_DRM_INVALID_STATE if the HAL is in a state where
105 * the security level cannot be set.
106 */
107 setSecurityLevel(vec<uint8_t> sessionId, SecurityLevel level)
108 generates(Status status);
109};