diff options
author | Robert Shih <robertshih@google.com> | 2022-02-07 16:43:42 -0800 |
---|---|---|
committer | Robert Shih <robertshih@google.com> | 2022-02-09 18:13:45 -0800 |
commit | fe6d6b122c87e7cb9fb6547f07671e223f505f09 (patch) | |
tree | a111b0e5494283cd8761fd1b773ecfbc8b9e4dce | |
parent | 55a87cc169de8b9e402fae2e564657be0bf69d36 (diff) |
drm hal aidl API cleanup
* Merge IDrmFactory / ICryptoFactory
* Simplify isContentTypeSupported / isCryptoSchemeSupported
* Remove requiresSecureDecoderDefault
* DecryptArgs
* DestinationBuffer union
* byte[16] Uuid
* KeyStatusType underscores
* setSharedBufferBase generic buffer type
Bug: 214410088
Test: VtsAidlHalDrmTargetTest
Change-Id: Ic30100af9bdb95aff9d140e093edb083c1b49592
22 files changed, 179 insertions, 227 deletions
diff --git a/compatibility_matrices/compatibility_matrix.current.xml b/compatibility_matrices/compatibility_matrix.current.xml index 18b3885de9..541c1bb2a5 100644 --- a/compatibility_matrices/compatibility_matrix.current.xml +++ b/compatibility_matrices/compatibility_matrix.current.xml @@ -222,10 +222,6 @@ <name>android.hardware.drm</name> <version>1</version> <interface> - <name>ICryptoFactory</name> - <regex-instance>.*</regex-instance> - </interface> - <interface> <name>IDrmFactory</name> <regex-instance>.*</regex-instance> </interface> diff --git a/drm/aidl/aidl_api/android.hardware.drm/current/android/hardware/drm/BufferType.aidl b/drm/aidl/aidl_api/android.hardware.drm/current/android/hardware/drm/BufferType.aidl deleted file mode 100644 index b6ec34d897..0000000000 --- a/drm/aidl/aidl_api/android.hardware.drm/current/android/hardware/drm/BufferType.aidl +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright (C) 2021 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/////////////////////////////////////////////////////////////////////////////// -// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // -/////////////////////////////////////////////////////////////////////////////// - -// This file is a snapshot of an AIDL file. Do not edit it manually. There are -// two cases: -// 1). this is a frozen version file - do not edit this in any case. -// 2). this is a 'current' file. If you make a backwards compatible change to -// the interface (from the latest frozen version), the build system will -// prompt you to update this file with `m <name>-update-api`. -// -// You must not make a backward incompatible change to any AIDL file built -// with the aidl_interface module type with versions property set. The module -// type is used to build AIDL files in a way that they can be used across -// independently updatable components of the system. If a device is shipped -// with such a backward incompatible change, it has a high risk of breaking -// later when a module using the interface is updated, e.g., Mainline modules. - -package android.hardware.drm; -@Backing(type="int") @VintfStability -enum BufferType { - SHARED_MEMORY = 0, - NATIVE_HANDLE = 1, -} diff --git a/drm/aidl/aidl_api/android.hardware.drm/current/android/hardware/drm/DecryptResult.aidl b/drm/aidl/aidl_api/android.hardware.drm/current/android/hardware/drm/CryptoSchemes.aidl index d2b48d2b98..ea736cf373 100644 --- a/drm/aidl/aidl_api/android.hardware.drm/current/android/hardware/drm/DecryptResult.aidl +++ b/drm/aidl/aidl_api/android.hardware.drm/current/android/hardware/drm/CryptoSchemes.aidl @@ -1,5 +1,5 @@ /* - * Copyright (C) 2021 The Android Open Source Project + * Copyright (C) 2022 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -33,7 +33,9 @@ package android.hardware.drm; @VintfStability -parcelable DecryptResult { - int bytesWritten; - String detailedError; +parcelable CryptoSchemes { + List<android.hardware.drm.Uuid> uuids; + android.hardware.drm.SecurityLevel minLevel; + android.hardware.drm.SecurityLevel maxLevel; + List<String> mimeTypes; } diff --git a/drm/aidl/aidl_api/android.hardware.drm/current/android/hardware/drm/ICryptoFactory.aidl b/drm/aidl/aidl_api/android.hardware.drm/current/android/hardware/drm/DecryptArgs.aidl index 0d4296ec1f..9c574a48ef 100644 --- a/drm/aidl/aidl_api/android.hardware.drm/current/android/hardware/drm/ICryptoFactory.aidl +++ b/drm/aidl/aidl_api/android.hardware.drm/current/android/hardware/drm/DecryptArgs.aidl @@ -1,5 +1,5 @@ /* - * Copyright (C) 2021 The Android Open Source Project + * Copyright (C) 2022 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -33,7 +33,14 @@ package android.hardware.drm; @VintfStability -interface ICryptoFactory { - @nullable android.hardware.drm.ICryptoPlugin createPlugin(in android.hardware.drm.Uuid uuid, in byte[] initData); - boolean isCryptoSchemeSupported(in android.hardware.drm.Uuid uuid); +parcelable DecryptArgs { + boolean secure; + byte[] keyId; + byte[] iv; + android.hardware.drm.Mode mode; + android.hardware.drm.Pattern pattern; + android.hardware.drm.SubSample[] subSamples; + android.hardware.drm.SharedBuffer source; + long offset; + android.hardware.drm.DestinationBuffer destination; } diff --git a/drm/aidl/aidl_api/android.hardware.drm/current/android/hardware/drm/DestinationBuffer.aidl b/drm/aidl/aidl_api/android.hardware.drm/current/android/hardware/drm/DestinationBuffer.aidl index 4f2d133cae..8c3ba7d0b7 100644 --- a/drm/aidl/aidl_api/android.hardware.drm/current/android/hardware/drm/DestinationBuffer.aidl +++ b/drm/aidl/aidl_api/android.hardware.drm/current/android/hardware/drm/DestinationBuffer.aidl @@ -33,8 +33,7 @@ package android.hardware.drm; @VintfStability -parcelable DestinationBuffer { - android.hardware.drm.BufferType type; +union DestinationBuffer { android.hardware.drm.SharedBuffer nonsecureMemory; android.hardware.common.NativeHandle secureMemory; } diff --git a/drm/aidl/aidl_api/android.hardware.drm/current/android/hardware/drm/ICryptoPlugin.aidl b/drm/aidl/aidl_api/android.hardware.drm/current/android/hardware/drm/ICryptoPlugin.aidl index 2224795198..31c45e0e1f 100644 --- a/drm/aidl/aidl_api/android.hardware.drm/current/android/hardware/drm/ICryptoPlugin.aidl +++ b/drm/aidl/aidl_api/android.hardware.drm/current/android/hardware/drm/ICryptoPlugin.aidl @@ -34,10 +34,10 @@ package android.hardware.drm; @VintfStability interface ICryptoPlugin { - android.hardware.drm.DecryptResult decrypt(in boolean secure, in byte[] keyId, in byte[] iv, in android.hardware.drm.Mode mode, in android.hardware.drm.Pattern pattern, in android.hardware.drm.SubSample[] subSamples, in android.hardware.drm.SharedBuffer source, in long offset, in android.hardware.drm.DestinationBuffer destination); + int decrypt(in android.hardware.drm.DecryptArgs args); List<android.hardware.drm.LogMessage> getLogMessages(); void notifyResolution(in int width, in int height); boolean requiresSecureDecoderComponent(in String mime); void setMediaDrmSession(in byte[] sessionId); - void setSharedBufferBase(in android.hardware.common.Ashmem base, in int bufferId); + void setSharedBufferBase(in android.hardware.drm.SharedBuffer base); } diff --git a/drm/aidl/aidl_api/android.hardware.drm/current/android/hardware/drm/IDrmFactory.aidl b/drm/aidl/aidl_api/android.hardware.drm/current/android/hardware/drm/IDrmFactory.aidl index af48737892..82efbb7ea0 100644 --- a/drm/aidl/aidl_api/android.hardware.drm/current/android/hardware/drm/IDrmFactory.aidl +++ b/drm/aidl/aidl_api/android.hardware.drm/current/android/hardware/drm/IDrmFactory.aidl @@ -34,8 +34,7 @@ package android.hardware.drm; @VintfStability interface IDrmFactory { - @nullable android.hardware.drm.IDrmPlugin createPlugin(in android.hardware.drm.Uuid uuid, in String appPackageName); - List<android.hardware.drm.Uuid> getSupportedCryptoSchemes(); - boolean isContentTypeSupported(in String mimeType); - boolean isCryptoSchemeSupported(in android.hardware.drm.Uuid uuid, in String mimeType, in android.hardware.drm.SecurityLevel securityLevel); + @nullable android.hardware.drm.IDrmPlugin createDrmPlugin(in android.hardware.drm.Uuid uuid, in String appPackageName); + @nullable android.hardware.drm.ICryptoPlugin createCryptoPlugin(in android.hardware.drm.Uuid uuid, in byte[] initData); + android.hardware.drm.CryptoSchemes getSupportedCryptoSchemes(); } diff --git a/drm/aidl/aidl_api/android.hardware.drm/current/android/hardware/drm/IDrmPlugin.aidl b/drm/aidl/aidl_api/android.hardware.drm/current/android/hardware/drm/IDrmPlugin.aidl index 5f839d763c..ae10062c81 100644 --- a/drm/aidl/aidl_api/android.hardware.drm/current/android/hardware/drm/IDrmPlugin.aidl +++ b/drm/aidl/aidl_api/android.hardware.drm/current/android/hardware/drm/IDrmPlugin.aidl @@ -63,7 +63,6 @@ interface IDrmPlugin { void removeOfflineLicense(in android.hardware.drm.KeySetId keySetId); void removeSecureStop(in android.hardware.drm.SecureStopId secureStopId); boolean requiresSecureDecoder(in String mime, in android.hardware.drm.SecurityLevel level); - boolean requiresSecureDecoderDefault(in String mime); void restoreKeys(in byte[] sessionId, in android.hardware.drm.KeySetId keySetId); void setCipherAlgorithm(in byte[] sessionId, in String algorithm); void setListener(in android.hardware.drm.IDrmPluginListener listener); diff --git a/drm/aidl/aidl_api/android.hardware.drm/current/android/hardware/drm/KeyStatusType.aidl b/drm/aidl/aidl_api/android.hardware.drm/current/android/hardware/drm/KeyStatusType.aidl index e88d3886a2..261516f8ef 100644 --- a/drm/aidl/aidl_api/android.hardware.drm/current/android/hardware/drm/KeyStatusType.aidl +++ b/drm/aidl/aidl_api/android.hardware.drm/current/android/hardware/drm/KeyStatusType.aidl @@ -36,8 +36,8 @@ package android.hardware.drm; enum KeyStatusType { USABLE = 0, EXPIRED = 1, - OUTPUTNOTALLOWED = 2, - STATUSPENDING = 3, - INTERNALERROR = 4, - USABLEINFUTURE = 5, + OUTPUT_NOT_ALLOWED = 2, + STATUS_PENDING = 3, + INTERNAL_ERROR = 4, + USABLE_IN_FUTURE = 5, } diff --git a/drm/aidl/aidl_api/android.hardware.drm/current/android/hardware/drm/SharedBuffer.aidl b/drm/aidl/aidl_api/android.hardware.drm/current/android/hardware/drm/SharedBuffer.aidl index 973ef0db3d..314fe7cf00 100644 --- a/drm/aidl/aidl_api/android.hardware.drm/current/android/hardware/drm/SharedBuffer.aidl +++ b/drm/aidl/aidl_api/android.hardware.drm/current/android/hardware/drm/SharedBuffer.aidl @@ -37,4 +37,5 @@ parcelable SharedBuffer { int bufferId; long offset; long size; + android.hardware.common.NativeHandle handle; } diff --git a/drm/aidl/aidl_api/android.hardware.drm/current/android/hardware/drm/Uuid.aidl b/drm/aidl/aidl_api/android.hardware.drm/current/android/hardware/drm/Uuid.aidl index ec2eb164c9..3c2cfa2037 100644 --- a/drm/aidl/aidl_api/android.hardware.drm/current/android/hardware/drm/Uuid.aidl +++ b/drm/aidl/aidl_api/android.hardware.drm/current/android/hardware/drm/Uuid.aidl @@ -34,5 +34,5 @@ package android.hardware.drm; @VintfStability parcelable Uuid { - byte[] uuid; + byte[16] uuid; } diff --git a/drm/aidl/android/hardware/drm/BufferType.aidl b/drm/aidl/android/hardware/drm/BufferType.aidl deleted file mode 100644 index 089c950656..0000000000 --- a/drm/aidl/android/hardware/drm/BufferType.aidl +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Copyright (C) 2021 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package android.hardware.drm; - -@VintfStability -@Backing(type="int") -enum BufferType { - SHARED_MEMORY = 0, - NATIVE_HANDLE = 1, -} diff --git a/drm/aidl/android/hardware/drm/DecryptResult.aidl b/drm/aidl/android/hardware/drm/CryptoSchemes.aidl index 17e939bc95..b4b34ec17e 100644 --- a/drm/aidl/android/hardware/drm/DecryptResult.aidl +++ b/drm/aidl/android/hardware/drm/CryptoSchemes.aidl @@ -1,5 +1,5 @@ /* - * Copyright (C) 2021 The Android Open Source Project + * Copyright (C) 2022 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,18 +16,30 @@ package android.hardware.drm; -/** - * The DecryptResult parcelable contains the result of - * ICryptoPlugin decrypt method. - */ +import android.hardware.drm.SecurityLevel; +import android.hardware.drm.Uuid; + @VintfStability -parcelable DecryptResult { - /** The number of decrypted bytes. */ - int bytesWritten; +parcelable CryptoSchemes { + + /** + * Supported crypto schemes + */ + List<Uuid> uuids; + + /** + * Minimum supported security level (inclusive) + */ + SecurityLevel minLevel; + + /** + * Maximum supported security level (inclusive) + */ + SecurityLevel maxLevel; /** - * Vendor-specific error message if provided by the vendor's - * crypto HAL. + * Supported mime types */ - String detailedError; + List<String> mimeTypes; + } diff --git a/drm/aidl/android/hardware/drm/DecryptArgs.aidl b/drm/aidl/android/hardware/drm/DecryptArgs.aidl new file mode 100644 index 0000000000..5ec1b7154e --- /dev/null +++ b/drm/aidl/android/hardware/drm/DecryptArgs.aidl @@ -0,0 +1,87 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.drm; + +import android.hardware.drm.DestinationBuffer; +import android.hardware.drm.KeyStatusType; +import android.hardware.drm.Mode; +import android.hardware.drm.Pattern; +import android.hardware.drm.SharedBuffer; +import android.hardware.drm.SubSample; + +/** + * Arguments to ICryptoPlugin decrypt + */ +@VintfStability +parcelable DecryptArgs { + + /** + * A flag to indicate if a secure decoder is being used. + * + * This enables the plugin to configure buffer modes to work consistently + * with a secure decoder. + */ + boolean secure; + + /** + * The keyId for the key that is used to do the decryption. + * + * The keyId refers to a key in the associated MediaDrm instance. + */ + byte[] keyId; + + /** + * The initialization vector + */ + byte[] iv; + + /** + * Crypto mode + */ + Mode mode; + + /** + * Crypto pattern + */ + Pattern pattern; + + /** + * A vector of subsamples indicating the number of clear and encrypted + * bytes to process. + * + * This allows the decrypt call to operate on a range of subsamples in a + * single call + */ + SubSample[] subSamples; + + /** + * Input buffer for the decryption + */ + SharedBuffer source; + + /** + * The offset of the first byte of encrypted data from the base of the + * source buffer + */ + long offset; + + /** + * Output buffer for the decryption + */ + DestinationBuffer destination; + +} diff --git a/drm/aidl/android/hardware/drm/DestinationBuffer.aidl b/drm/aidl/android/hardware/drm/DestinationBuffer.aidl index 0f1e3f5398..7fc61e1676 100644 --- a/drm/aidl/android/hardware/drm/DestinationBuffer.aidl +++ b/drm/aidl/android/hardware/drm/DestinationBuffer.aidl @@ -17,29 +17,24 @@ package android.hardware.drm; import android.hardware.common.NativeHandle; -import android.hardware.drm.BufferType; import android.hardware.drm.SharedBuffer; /** * A decrypt destination buffer can be either normal user-space shared * memory for the non-secure decrypt case, or it can be a secure buffer - * which is referenced by a native-handle. The native handle is allocated - * by the vendor's buffer allocator. + * which is referenced by a native-handle. + * + * The native handle is allocated by the vendor's buffer allocator. */ @VintfStability -parcelable DestinationBuffer { - /** - * The type of the buffer - */ - BufferType type; +union DestinationBuffer { /** - * If type == SHARED_MEMORY, the decrypted data must be written - * to user-space non-secure shared memory. + * decrypted data written to user-space non-secure shared memory. */ SharedBuffer nonsecureMemory; /** - * If type == NATIVE_HANDLE, the decrypted data must be written - * to secure memory referenced by the vendor's buffer allocator. + * decrypted data written to secure memory referenced by the vendor's + * buffer allocator. */ NativeHandle secureMemory; } diff --git a/drm/aidl/android/hardware/drm/ICryptoFactory.aidl b/drm/aidl/android/hardware/drm/ICryptoFactory.aidl deleted file mode 100644 index 202bd3dbfe..0000000000 --- a/drm/aidl/android/hardware/drm/ICryptoFactory.aidl +++ /dev/null @@ -1,51 +0,0 @@ -/* - * Copyright (C) 2021 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package android.hardware.drm; - -import android.hardware.drm.Uuid; - -/** - * ICryptoFactory is the main entry point for interacting with a vendor's - * crypto HAL to create crypto plugins. - - * Crypto plugins create crypto sessions which are used by a codec to decrypt - * protected video content. - */ -@VintfStability -interface ICryptoFactory { - /** - * Create a crypto plugin for the specified uuid and scheme-specific - * initialization data. - * - * @param uuid uniquely identifies the drm scheme. See - * http://dashif.org/identifiers/protection for uuid assignments - * - * @param initData scheme-specific init data. - * - * @return A crypto plugin instance if successful, or null if not created. - */ - @nullable android.hardware.drm.ICryptoPlugin createPlugin( - in Uuid uuid, in byte[] initData); - - /** - * Determine if a crypto scheme is supported by this HAL. - * - * @param uuid identifies the crypto scheme in question - * @return must be true only if the scheme is supported - */ - boolean isCryptoSchemeSupported(in Uuid uuid); -} diff --git a/drm/aidl/android/hardware/drm/ICryptoPlugin.aidl b/drm/aidl/android/hardware/drm/ICryptoPlugin.aidl index 80a63dfdae..d344b62a7a 100644 --- a/drm/aidl/android/hardware/drm/ICryptoPlugin.aidl +++ b/drm/aidl/android/hardware/drm/ICryptoPlugin.aidl @@ -17,7 +17,7 @@ package android.hardware.drm; import android.hardware.common.Ashmem; -import android.hardware.drm.DecryptResult; +import android.hardware.drm.DecryptArgs; import android.hardware.drm.DestinationBuffer; import android.hardware.drm.LogMessage; import android.hardware.drm.Mode; @@ -38,23 +38,7 @@ interface ICryptoPlugin { * Decrypt an array of subsamples from the source memory buffer to the * destination memory buffer. * - * @param secure a flag to indicate if a secure decoder is being used. - * This enables the plugin to configure buffer modes to work - * consistently with a secure decoder. - * @param the keyId for the key that is used to do the decryption. The - * keyId refers to a key in the associated MediaDrm instance. - * @param iv the initialization vector to use - * @param mode the crypto mode to use - * @param pattern the crypto pattern to use - * @param subSamples a vector of subsamples indicating the number - * of clear and encrypted bytes to process. This allows the decrypt - * call to operate on a range of subsamples in a single call - * @param source the input buffer for the decryption - * @param offset the offset of the first byte of encrypted data from - * the base of the source buffer - * @param destination the output buffer for the decryption - * - * @return DecryptResult parcelable + * @return number of decrypted bytes * Implicit error codes: * + ERROR_DRM_CANNOT_HANDLE in other failure cases * + ERROR_DRM_DECRYPT if the decrypt operation fails @@ -74,9 +58,7 @@ interface ICryptoPlugin { * + ERROR_DRM_SESSION_NOT_OPENED if the decrypt session is not * opened */ - DecryptResult decrypt(in boolean secure, in byte[] keyId, in byte[] iv, in Mode mode, - in Pattern pattern, in SubSample[] subSamples, in SharedBuffer source, in long offset, - in DestinationBuffer destination); + int decrypt(in DecryptArgs args); /** * Get OEMCrypto or plugin error messages. @@ -129,10 +111,8 @@ interface ICryptoPlugin { * There can be multiple shared buffers per crypto plugin. The buffers * are distinguished by the bufferId. * - * @param base the base of the memory buffer identified by - * bufferId - * @param bufferId identifies the specific shared buffer for which - * the base is being set. + * @param base the base of the memory buffer abstracted by + * SharedBuffer parcelable (bufferId, size, handle) */ - void setSharedBufferBase(in Ashmem base, in int bufferId); + void setSharedBufferBase(in SharedBuffer base); } diff --git a/drm/aidl/android/hardware/drm/IDrmFactory.aidl b/drm/aidl/android/hardware/drm/IDrmFactory.aidl index b9622a427b..86c3f21a10 100644 --- a/drm/aidl/android/hardware/drm/IDrmFactory.aidl +++ b/drm/aidl/android/hardware/drm/IDrmFactory.aidl @@ -16,6 +16,7 @@ package android.hardware.drm; +import android.hardware.drm.CryptoSchemes; import android.hardware.drm.SecurityLevel; import android.hardware.drm.Uuid; @@ -40,37 +41,30 @@ interface IDrmFactory { * Implicit error codes: * + ERROR_DRM_CANNOT_HANDLE if the plugin cannot be created. */ - @nullable android.hardware.drm.IDrmPlugin createPlugin( + @nullable android.hardware.drm.IDrmPlugin createDrmPlugin( in Uuid uuid, in String appPackageName); /** - * Return vector of uuids identifying crypto schemes supported by - * this HAL. + * Create a crypto plugin for the specified uuid and scheme-specific + * initialization data. * - * @return List of uuids for which isCryptoSchemeSupported is true; - * each uuid can be used as input to createPlugin. - */ - List<Uuid> getSupportedCryptoSchemes(); - - /** - * Determine if the HAL factory is able to construct plugins that - * support a given media container format specified by mimeType + * @param uuid uniquely identifies the drm scheme. See + * http://dashif.org/identifiers/protection for uuid assignments * - * @param mimeType identifies the mime type in question + * @param initData scheme-specific init data. * - * @return must be true only if the scheme is supported + * @return A crypto plugin instance if successful, or null if not created. */ - boolean isContentTypeSupported(in String mimeType); + @nullable android.hardware.drm.ICryptoPlugin createCryptoPlugin( + in Uuid uuid, in byte[] initData); /** - * Determine if a specific security level is supported by the device. - * - * @param uuid identifies the crypto scheme in question - * @param mimeType identifies the mime type in question - * @param securityLevel specifies the security level required + * Return vector of uuids identifying crypto schemes supported by + * this HAL. * - * @return must be true only if the scheme is supported + * @return List of uuids for which isCryptoSchemeSupported is true; + * each uuid can be used as input to createPlugin. */ - boolean isCryptoSchemeSupported( - in Uuid uuid, in String mimeType, in SecurityLevel securityLevel); + CryptoSchemes getSupportedCryptoSchemes(); + } diff --git a/drm/aidl/android/hardware/drm/IDrmPlugin.aidl b/drm/aidl/android/hardware/drm/IDrmPlugin.aidl index e649f264ea..11ca8b6491 100644 --- a/drm/aidl/android/hardware/drm/IDrmPlugin.aidl +++ b/drm/aidl/android/hardware/drm/IDrmPlugin.aidl @@ -577,17 +577,6 @@ interface IDrmPlugin { boolean requiresSecureDecoder(in String mime, in SecurityLevel level); /** - * Check if the specified mime-type requires a secure decoder component - * at the highest security level supported on the device. - * - * @param mime The content mime-type - * - * @return must be true if and only if a secure decoder is required - * for the specified mime-type - */ - boolean requiresSecureDecoderDefault(in String mime); - - /** * Restore persisted offline keys into a new session * * @param sessionId the session id the call applies to diff --git a/drm/aidl/android/hardware/drm/KeyStatusType.aidl b/drm/aidl/android/hardware/drm/KeyStatusType.aidl index 6902d8708c..6c3c6a2363 100644 --- a/drm/aidl/android/hardware/drm/KeyStatusType.aidl +++ b/drm/aidl/android/hardware/drm/KeyStatusType.aidl @@ -32,20 +32,20 @@ enum KeyStatusType { * The key is not currently usable to decrypt media data because its output * requirements cannot currently be met. */ - OUTPUTNOTALLOWED, + OUTPUT_NOT_ALLOWED, /** * The status of the key is not yet known and is being determined. */ - STATUSPENDING, + STATUS_PENDING, /** * The key is not currently usable to decrypt media data because of an * internal error in processing unrelated to input parameters. */ - INTERNALERROR, + INTERNAL_ERROR, /** * The key is not yet usable to decrypt media because the start * time is in the future. The key must become usable when * its start time is reached. */ - USABLEINFUTURE, + USABLE_IN_FUTURE, } diff --git a/drm/aidl/android/hardware/drm/SharedBuffer.aidl b/drm/aidl/android/hardware/drm/SharedBuffer.aidl index 69772840ba..2b2610f4bc 100644 --- a/drm/aidl/android/hardware/drm/SharedBuffer.aidl +++ b/drm/aidl/android/hardware/drm/SharedBuffer.aidl @@ -16,6 +16,8 @@ package android.hardware.drm; +import android.hardware.common.NativeHandle; + /** * SharedBuffer describes a decrypt buffer which is defined by a bufferId, an * offset and a size. The offset is relative to the shared memory base for the @@ -36,4 +38,8 @@ parcelable SharedBuffer { * The size of the shared buffer in bytes */ long size; + /** + * Handle to shared memory + */ + NativeHandle handle; } diff --git a/drm/aidl/android/hardware/drm/Uuid.aidl b/drm/aidl/android/hardware/drm/Uuid.aidl index b36c409c66..db5a70d349 100644 --- a/drm/aidl/android/hardware/drm/Uuid.aidl +++ b/drm/aidl/android/hardware/drm/Uuid.aidl @@ -18,5 +18,5 @@ package android.hardware.drm; @VintfStability parcelable Uuid { - byte[] uuid; + byte[16] uuid; } |