Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 045ff830 authored by Jeff Tinker's avatar Jeff Tinker Committed by Android (Google) Code Review
Browse files

Merge "Changes to drm and crypto HALs as part of client implementation"

parents 5bf8664c b3a16724
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -40,8 +40,9 @@ interface ICryptoFactory {
     * @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)
+3 −6
Original line number Diff line number Diff line
@@ -74,8 +74,8 @@ interface ICryptoPlugin {
     * 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 @@ interface ICryptoPlugin {
     * 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);
};
+1 −1
Original line number Diff line number Diff line
@@ -119,7 +119,7 @@ namespace implementation {
            bytesWritten = 0;
        }

        _hidl_cb(toStatus(status), bytesWritten, detailMessage.c_str());
        _hidl_cb(toStatus(status), bytesWritten);
        return Void();
    }

+3 −0
Original line number Diff line number Diff line
@@ -26,6 +26,9 @@ namespace implementation {
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;
+6 −0
Original line number Diff line number Diff line
@@ -17,6 +17,12 @@
package android.hardware.drm.crypto@1.0;

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
Loading