blob: 88338d6af3e6b4a7cc5a210d6a676b7305a86afc [file] [log] [blame]
Jeff Tinker287ef4c2018-10-12 13:08:55 -07001/**
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 */
16package android.hardware.drm@1.2;
17
18import @1.1::IDrmPlugin;
19import @1.0::Status;
20
21/**
22 * IDrmPlugin is used to interact with a specific drm plugin that was created by
23 * IDrm::createPlugin. A drm plugin provides methods for obtaining drm keys that
24 * may be used by a codec to decrypt protected video content.
25 */
26interface IDrmPlugin extends @1.1::IDrmPlugin {
27
28 /**
29 * The keys in an offline license allow protected content to be
30 * played even if the device is not connected to a network.
31 * Offline licenses are stored on the device after a key
32 * request/response exchange when the key request KeyType is
33 * OFFLINE. Normally each app is responsible for keeping track of
34 * the KeySetIds it has created. In some situations however, it
35 * may be necessary to request the list of stored offline license
36 * KeySetIds. If an app loses the KeySetId for any stored licenses
37 * that it created, for example, it must be able to recover the
38 * stored KeySetIds so those licenses can be removed when they
39 * expire or when the app is uninstalled.
40 * <p>
41 * This method returns a list of the KeySetIds for all offline
42 * licenses. The offline license KeySetId may be used to query
43 * the status of an offline license or remove it.
44 *
45 * @return status the status of the call. May be OK or
46 * ERROR_DRM_INVALID_STATE if the HAL is in a state where the
47 * KeySetIds can't be returned.
48 * @return a list of offline license keySetIds. If there are no offline
49 * licenses, the list must be empty and OK must be returned as the
50 * status.
51 */
52 getOfflineLicenseKeySetIds() generates (Status status, vec<KeySetId> keySetIds);
53
54 /**
55 * Normally offline licenses are released using a key
56 * request/response exchange using getKeyRequest where the KeyType
57 * is RELEASE, followed by provideKeyResponse. This allows the
58 * server to cryptographically confirm that the license has been
59 * removed and then adjust the count of offline licenses allocated
60 * to the device.
61 * <p>
62 * In some exceptional situations it may be necessary to directly
63 * remove offline licenses without notifying the server, which may
64 * be performed using this method.
65 *
66 * @param keySetId the id of the offline license to remove
67 * @return status the status of the call. May be one of OK on
68 * success, BAD_VALUE if the license is not found or
69 * ERROR_DRM_INVALID_STATE if the HAL is in a state where the
70 * KeySetIds can't be returned.
71 */
72 removeOfflineLicense(KeySetId keySetId) generates (Status status);
73
74 /**
75 * Request the state of an offline license. An offline license may
76 * be usable or inactive. The keys in a usable offline license are
77 * available for decryption. When the offline license state is
78 * inactive, the keys have been marked for release using
79 * getKeyRequest with KeyType RELEASE but the key response has not
80 * been received. The keys in an inactive offline license are not
81 * usable for decryption.
82 *
83 * @param keySetId the id of the offline license
84 * @return status the status of the call. May be one of OK on
85 * success, BAD_VALUE if the license is not found or
86 * ERROR_DRM_INVALID_STATE if the HAL is in a state where the
87 * offline license state can't be queried.
88 * @return the offline license state, one of USABLE or INACTIVE.
89 * If the return status is not OK then state must be set to
90 * UNKNOWN.
91 */
92 getOfflineLicenseState(KeySetId keySetId) generates (Status status,
93 OfflineLicenseState state);
94};