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