Changes to drm and crypto HALs as part of client implementation
bug: 32815560
Change-Id: Iced6218014dfc921c94e38db8f7f634ab75b7a75
diff --git a/drm/crypto/1.0/ICryptoFactory.hal b/drm/crypto/1.0/ICryptoFactory.hal
index 0ac7828..4b60ccc 100644
--- a/drm/crypto/1.0/ICryptoFactory.hal
+++ b/drm/crypto/1.0/ICryptoFactory.hal
@@ -40,8 +40,9 @@
* @param uuid uniquely identifies the drm scheme. See
* http://dashif.org/identifiers/protection for uuid assignments
* @param initData scheme-specific init data.
- * @return status the status of the call. If the plugin can't
- * be created, the HAL implementation must return ERROR_DRM_CANNOT_HANDLE.
+ * @return status the status of the call. The HAL implementation must return
+ * OK if the plugin is created and ERROR_DRM_CANNOT_HANDLE if the plugin
+ * cannot be created.
* @return cryptoPlugin the created ICryptoPlugin
*/
createPlugin(uint8_t[16] uuid, vec<uint8_t> initData)
diff --git a/drm/crypto/1.0/ICryptoPlugin.hal b/drm/crypto/1.0/ICryptoPlugin.hal
index e86c9f2..e892e3c 100644
--- a/drm/crypto/1.0/ICryptoPlugin.hal
+++ b/drm/crypto/1.0/ICryptoPlugin.hal
@@ -74,8 +74,8 @@
* call to operate on a range of subsamples in a single call
* @param source the input buffer for the decryption
* @param destination the output buffer for the decryption
- * @return status the status of the call. The status must be one of
- * the following: ERROR_DRM_NO_LICENSE if no license keys have been
+ * @return status the status of the call. The status must be OK or one of
+ * the following errors: ERROR_DRM_NO_LICENSE if no license keys have been
* loaded, ERROR_DRM_LICENSE_EXPIRED if the license keys have expired,
* ERROR_DRM_RESOURCE_BUSY if the resources required to perform the
* decryption are not available, ERROR_DRM_INSUFFICIENT_OUTPUT_PROTECTION
@@ -83,12 +83,9 @@
* ERROR_DRM_SESSION_NOT_OPENED if the decrypt session is not opened, or
* ERROR_DRM_CANNOT_HANDLE in other failure cases.
* @return bytesWritten the number of bytes output from the decryption
- * @return detailedError if the error is a vendor-specific error, the
- * vendor's crypto HAL may provide a detailed error string to help
- * describe the error.
*/
decrypt(bool secure, uint8_t[16] keyId, uint8_t[16] iv, Mode mode,
Pattern pattern, vec<SubSample> subSamples,
memory source, DestinationBuffer destination)
- generates(Status status, uint32_t bytesWritten, string detailedError);
+ generates(Status status, uint32_t bytesWritten);
};
diff --git a/drm/crypto/1.0/default/CryptoPlugin.cpp b/drm/crypto/1.0/default/CryptoPlugin.cpp
index 9173d5b..7921852 100644
--- a/drm/crypto/1.0/default/CryptoPlugin.cpp
+++ b/drm/crypto/1.0/default/CryptoPlugin.cpp
@@ -119,7 +119,7 @@
bytesWritten = 0;
}
- _hidl_cb(toStatus(status), bytesWritten, detailMessage.c_str());
+ _hidl_cb(toStatus(status), bytesWritten);
return Void();
}
diff --git a/drm/crypto/1.0/default/TypeConvert.cpp b/drm/crypto/1.0/default/TypeConvert.cpp
index d9cca6b..ed95d15 100644
--- a/drm/crypto/1.0/default/TypeConvert.cpp
+++ b/drm/crypto/1.0/default/TypeConvert.cpp
@@ -26,6 +26,9 @@
Status toStatus(status_t legacyStatus) {
Status status;
switch(legacyStatus) {
+ case android::OK:
+ status = Status::OK;
+ break;
case android::ERROR_DRM_NO_LICENSE:
status = Status::ERROR_DRM_NO_LICENSE;
break;
diff --git a/drm/crypto/1.0/types.hal b/drm/crypto/1.0/types.hal
index 7e853b8..e71d73a 100644
--- a/drm/crypto/1.0/types.hal
+++ b/drm/crypto/1.0/types.hal
@@ -18,6 +18,12 @@
enum Status : uint32_t {
/**
+ * The Crypto plugin must return OK when an operation completes without any
+ * errors.
+ */
+ OK,
+
+ /**
* The Crypto Plugin must return ERROR_DRM_NO_LICENSE if decryption is
* attempted when the license keys have not been loaded into the crypto
* session.