Merge "Return<*> getStatus().isOk() -> isOk()"
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.
diff --git a/drm/drm/1.0/IDrmFactory.hal b/drm/drm/1.0/IDrmFactory.hal
index a58bcaa..1ef1d27 100644
--- a/drm/drm/1.0/IDrmFactory.hal
+++ b/drm/drm/1.0/IDrmFactory.hal
@@ -36,14 +36,23 @@
isCryptoSchemeSupported(uint8_t[16] uuid) generates(bool isSupported);
/**
+ * Determine if the HAL factory is able to construct plugins that support a
+ * given media container format specified by mimeType
+ *
+ * @param mimeType identifies the mime type in question
+ * @return isSupported must be true only if the scheme is supported
+ */
+ isContentTypeSupported(string mimeType) generates(bool isSupported);
+
+ /**
* Create a drm plugin instance 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
- * @return status the status of the call. If the plugin can't be created,
- * the HAL implementation must return ERROR_DRM_CANNOT_HANDLE.
- * @return drmPlugin the created IDrmPlugin
+ * @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.
*/
createPlugin(uint8_t[16] uuid) generates (Status status,
IDrmPlugin drmPlugin);
diff --git a/drm/drm/1.0/IDrmPlugin.hal b/drm/drm/1.0/IDrmPlugin.hal
index 2816c8a..881bf80 100644
--- a/drm/drm/1.0/IDrmPlugin.hal
+++ b/drm/drm/1.0/IDrmPlugin.hal
@@ -30,13 +30,13 @@
/**
* Open a new session with the DrmPlugin object. A session ID is returned
* in the sessionId parameter.
- * @return status the status of the call. The status must be one of
- * ERROR_DRM_NOT_PROVISIONED if the device requires provisioning before
- * it can open a session, ERROR_DRM_RESOURCE_BUSY if there are insufficent
- * resources available to open a session, ERROR_DRM_CANNOT_HANDLE,
- * if openSession is not supported at the time of the call or
- * ERROR_DRM_INVALID_STATE if the HAL is in a state where a session cannot
- * be opened.
+ * @return status the status of the call. The status must be OK or one of
+ * the following errors: ERROR_DRM_NOT_PROVISIONED if the device requires
+ * provisioning before it can open a session, ERROR_DRM_RESOURCE_BUSY if
+ * there are insufficent resources available to open a session,
+ * ERROR_DRM_CANNOT_HANDLE, if openSession is not supported at the time of
+ * the call or ERROR_DRM_INVALID_STATE if the HAL is in a state where a
+ * session cannot be opened.
* @return sessionId the session ID for the newly opened session
*/
openSession() generates (Status status, SessionId sessionId);
@@ -45,9 +45,9 @@
* Close a session on the DrmPlugin object
*
* @param sessionId the session id the call applies to
- * @return status the status of the call. The status must be one of
- * ERROR_DRM_SESSION_NOT_OPENED if the session is not opened,
- * BAD_VALUE if the sessionId is invalid or ERROR_DRM_INVALID_STATE
+ * @return status the status of the call. The status must be OK or one of
+ * the following errors: ERROR_DRM_SESSION_NOT_OPENED if the session is not
+ * opened, BAD_VALUE if the sessionId is invalid or ERROR_DRM_INVALID_STATE
* if the HAL is in a state where the session cannot be closed.
*/
closeSession(SessionId sessionId) generates (Status status);
@@ -75,13 +75,13 @@
* allow a client application to provide additional message parameters to
* the server.
*
- * @return status the status of the call. The status must be one of
- * ERROR_DRM_SESSION_NOT_OPENED if the session is not opened,
- * ERROR_DRM_NOT_PROVISIONED if the device requires provisioning before
- * it can generate a key request, ERROR_DRM_CANNOT_HANDLE if getKeyRequest
- * is not supported at the time of the call, BAD_VALUE if any parameters
- * are invalid or ERROR_DRM_INVALID_STATE if the HAL is in a state where
- * a key request cannot be generated.
+ * @return status the status of the call. The status must be OK or one of
+ * the following errors: ERROR_DRM_SESSION_NOT_OPENED if the session is not
+ * opened, ERROR_DRM_NOT_PROVISIONED if the device requires provisioning
+ * before it can generate a key request, ERROR_DRM_CANNOT_HANDLE if
+ * getKeyRequest is not supported at the time of the call, BAD_VALUE if any
+ * parameters are invalid or ERROR_DRM_INVALID_STATE if the HAL is in a state
+ * where a key request cannot be generated.
* @return request if successful, the opaque key request blob is returned
* @return requestType indicates type information about the returned
* request. The type may be one of INITIAL, RENEWAL or RELEASE. An
@@ -109,12 +109,12 @@
* @param response the response from the key server that is being
* provided to the drm HAL.
*
- * @return status the status of the call. The status must be one of
- * ERROR_DRM_SESSION_NOT_OPENED if the session is not opened,
- * ERROR_DRM_NOT_PROVISIONED if the device requires provisioning before
- * it can handle the key response, ERROR_DRM_DEVICE_REVOKED if the device
- * has been disabled by the license policy, ERROR_DRM_CANNOT_HANDLE if
- * provideKeyResponse is not supported at the time of the call, BAD_VALUE
+ * @return status the status of the call. The status must be OK or one of
+ * the following errors: ERROR_DRM_SESSION_NOT_OPENED if the session is not
+ * opened, ERROR_DRM_NOT_PROVISIONED if the device requires provisioning
+ * before it can handle the key response, ERROR_DRM_DEVICE_REVOKED if the
+ * device has been disabled by the license policy, ERROR_DRM_CANNOT_HANDLE
+ * if provideKeyResponse is not supported at the time of the call, BAD_VALUE
* if any parameters are invalid or ERROR_DRM_INVALID_STATE if the HAL is
* in a state where a key response cannot be handled.
* @return keySetId when the response is for an offline key request, a
@@ -130,9 +130,9 @@
* Remove the current keys from a session
*
* @param sessionId the session id the call applies to
- * @return status the status of the call. The status must be one of
- * ERROR_DRM_SESSION_NOT_OPENED if the session is not opened,
- * BAD_VALUE if the sessionId is invalid or ERROR_DRM_INVALID_STATE
+ * @return status the status of the call. The status must be OK or one of
+ * the following errors: ERROR_DRM_SESSION_NOT_OPENED if the session is not
+ * opened, BAD_VALUE if the sessionId is invalid or ERROR_DRM_INVALID_STATE
* if the HAL is in a state where the keys cannot be removed.
*/
removeKeys(SessionId sessionId) generates (Status status);
@@ -143,9 +143,9 @@
* @param sessionId the session id the call applies to
* @param keySetId identifies the keys to load, obtained from a prior
* call to provideKeyResponse().
- * @return status the status of the call. The status must be one of
- * ERROR_DRM_SESSION_NOT_OPENED if the session is not opened,
- * BAD_VALUE if any parameters are invalid or ERROR_DRM_INVALID_STATE
+ * @return status the status of the call. The status must be OK or one of
+ * the following errors: ERROR_DRM_SESSION_NOT_OPENED if the session is not
+ * opened, BAD_VALUE if any parameters are invalid or ERROR_DRM_INVALID_STATE
* if the HAL is in a state where keys cannot be restored.
*/
restoreKeys(SessionId sessionId,
@@ -159,9 +159,9 @@
* the field names for a particular drm scheme.
*
* @param sessionId the session id the call applies to
- * @return status the status of the call. The status must be one of
- * ERROR_DRM_SESSION_NOT_OPENED if the session is not opened,
- * BAD_VALUE if the sessionId is invalid or ERROR_DRM_INVALID_STATE
+ * @return status the status of the call. The status must be OK or one of
+ * the following errors: ERROR_DRM_SESSION_NOT_OPENED if the session is not
+ * opened, BAD_VALUE if the sessionId is invalid or ERROR_DRM_INVALID_STATE
* if the HAL is in a state where key status cannot be queried.
* @return infoList a list of name value pairs describing the license
*/
@@ -178,10 +178,10 @@
* @param certificateAuthority identifies the certificate authority. A
* certificate authority (CA) is an entity which issues digital certificates
* for use by other parties. It is an example of a trusted third party.
- * @return status the status of the call. The status must be one of
- * BAD_VALUE if the sessionId is invalid or ERROR_DRM_INVALID_STATE
- * if the HAL is in a state where the provision request cannot be
- * generated.
+ * @return status the status of the call. The status must be OK or one of
+ * the following errors: BAD_VALUE if the sessionId is invalid or
+ * ERROR_DRM_INVALID_STATE if the HAL is in a state where the provision
+ * request cannot be generated.
* @return request if successful the opaque certificate request blob
* is returned
* @return defaultUrl URL that the provisioning request should be
@@ -200,11 +200,11 @@
* @param response the opaque provisioning response received by the
* app from a provisioning server.
- * @return status the status of the call. The status must be one of
- * ERROR_DRM_DEVICE_REVOKED if the device has been disabled by the license
- * policy, BAD_VALUE if any parameters are invalid or ERROR_DRM_INVALID_STATE
- * if the HAL is in a state where the provision response cannot be
- * handled.
+ * @return status the status of the call. The status must be OK or one of
+ * the following errors: ERROR_DRM_DEVICE_REVOKED if the device has been
+ * disabled by the license policy, BAD_VALUE if any parameters are invalid
+ * or ERROR_DRM_INVALID_STATE if the HAL is in a state where the provision
+ * response cannot be handled.
* @return certificate the public certificate resulting from the provisioning
* operation, if any. An empty vector indicates that no certificate was
* returned.
@@ -237,7 +237,7 @@
/**
* Get all secure stops on the device
*
- * @return status the status of the call. The status must be
+ * @return status the status of the call. The status must be OK or
* ERROR_DRM_INVALID_STATE if the HAL is in a state where the secure stops
* cannot be returned.
* @return secureStops a list of the secure stop opaque objects
@@ -252,9 +252,10 @@
* secure stop ID is delivered by the key server as part of the key
* response and must also be known by the app.
*
- * @return status the status of the call. The status must be one of
- * BAD_VALUE if the secureStopId is invalid or ERROR_DRM_INVALID_STATE
- * if the HAL is in a state where the secure stop cannot be returned.
+ * @return status the status of the call. The status must be OK or one of
+ * the following errors: BAD_VALUE if the secureStopId is invalid or
+ * ERROR_DRM_INVALID_STATE if the HAL is in a state where the secure stop
+ * cannot be returned.
* @return secureStop the secure stop opaque object
*/
@@ -264,7 +265,7 @@
/**
* Release all secure stops on the device
*
- * @return status the status of the call. The status must be one of
+ * @return status the status of the call. The status must be OK or
* ERROR_DRM_INVALID_STATE if the HAL is in a state where the secure
* stops cannot be released.
*/
@@ -277,9 +278,10 @@
* secure stop ID is delivered by the key server as part of the key
* response and must also be known by the app.
*
- * @return status the status of the call. The status must be one of
- * BAD_VALUE if the secureStopId is invalid or ERROR_DRM_INVALID_STATE
- * if the HAL is in a state where the secure stop cannot be released.
+ * @return status the status of the call. The status must be OK or one of
+ * the following errors: BAD_VALUE if the secureStopId is invalid or
+ * ERROR_DRM_INVALID_STATE if the HAL is in a state where the secure stop
+ * cannot be released.
*/
releaseSecureStop(vec<uint8_t> secureStopId) generates (Status status);
@@ -305,10 +307,11 @@
* Read a string property value given the property name.
*
* @param propertyName the name of the property
- * @return status the status of the call. The status must be one of
- * BAD_VALUE if the property name is invalid, ERROR_DRM_CANNOT_HANDLE
- * if the property is not supported, or ERROR_DRM_INVALID_STATE if the
- * HAL is in a state where the property cannot be obtained.
+ * @return status the status of the call. The status must be OK or one of
+ * the following errors: BAD_VALUE if the property name is invalid,
+ * ERROR_DRM_CANNOT_HANDLE if the property is not supported, or
+ * ERROR_DRM_INVALID_STATE if the HAL is in a state where the property
+ * cannot be obtained.
* @return value the property value string
*/
getPropertyString(string propertyName)
@@ -318,10 +321,11 @@
* Read a byte array property value given the property name.
*
* @param propertyName the name of the property
- * @return status the status of the call. The status must be one of
- * BAD_VALUE if the property name is invalid, ERROR_DRM_CANNOT_HANDLE
- * if the property is not supported, or ERROR_DRM_INVALID_STATE if the
- * HAL is in a state where the property cannot be obtained.
+ * @return status the status of the call. The status must be OK or one of
+ * the following errors: BAD_VALUE if the property name is invalid,
+ * ERROR_DRM_CANNOT_HANDLE if the property is not supported, or
+ * ERROR_DRM_INVALID_STATE if the HAL is in a state where the property
+ * cannot be obtained.
* @return value the property value byte array
*/
getPropertyByteArray(string propertyName)
@@ -332,10 +336,11 @@
*
* @param propertyName the name of the property
* @param value the value to write
- * @return status the status of the call. The status must be one of
- * BAD_VALUE if the property name is invalid, ERROR_DRM_CANNOT_HANDLE
- * if the property is not supported, or ERROR_DRM_INVALID_STATE if the
- * HAL is in a state where the property cannot be set.
+ * @return status the status of the call. The status must be OK or one of
+ * the following errors: BAD_VALUE if the property name is invalid,
+ * ERROR_DRM_CANNOT_HANDLE if the property is not supported, or
+ * ERROR_DRM_INVALID_STATE if the HAL is in a state where the property
+ * cannot be set.
*/
setPropertyString(string propertyName, string value)
generates (Status status);
@@ -345,10 +350,11 @@
*
* @param propertyName the name of the property
* @param value the value to write
- * @return status the status of the call. The status must be one of
- * BAD_VALUE if the property name is invalid, ERROR_DRM_CANNOT_HANDLE
- * if the property is not supported, or ERROR_DRM_INVALID_STATE if the
- * HAL is in a state where the property cannot be set.
+ * @return status the status of the call. The status must be OK or one of
+ * the following errors: BAD_VALUE if the property name is invalid,
+ * ERROR_DRM_CANNOT_HANDLE if the property is not supported, or
+ * ERROR_DRM_INVALID_STATE if the HAL is in a state where the property
+ * cannot be set.
*/
setPropertyByteArray(string propertyName, vec<uint8_t> value )
generates (Status status);
@@ -366,9 +372,9 @@
* @param algorithm the algorithm to use. The string conforms to JCA
* Standard Names for Cipher Transforms and is case insensitive. An
* example algorithm is "AES/CBC/PKCS5Padding".
- * @return status the status of the call. The status must be one of
- * ERROR_DRM_SESSION_NOT_OPENED if the session is not opened,
- * BAD_VALUE if any parameters are invalid or ERROR_DRM_INVALID_STATE
+ * @return status the status of the call. The status must be OK or one of
+ * the following errors: ERROR_DRM_SESSION_NOT_OPENED if the session is not
+ * opened, BAD_VALUE if any parameters are invalid or ERROR_DRM_INVALID_STATE
* if the HAL is in a state where the algorithm cannot be set.
*/
setCipherAlgorithm(SessionId sessionId, string algorithm)
@@ -381,9 +387,9 @@
* @param algorithm the algorithm to use. The string conforms to JCA
* Standard Names for Mac Algorithms and is case insensitive. An example MAC
* algorithm string is "HmacSHA256".
- * @return status the status of the call. The status must be one of
- * ERROR_DRM_SESSION_NOT_OPENED if the session is not opened,
- * BAD_VALUE if any parameters are invalid or ERROR_DRM_INVALID_STATE
+ * @return status the status of the call. The status must be OK or one of the
+ * following errors: ERROR_DRM_SESSION_NOT_OPENED if the session is not
+ * opened, BAD_VALUE if any parameters are invalid or ERROR_DRM_INVALID_STATE
* if the HAL is in a state where the algorithm cannot be set.
*/
setMacAlgorithm(SessionId sessionId, string algorithm)
@@ -398,11 +404,10 @@
* @param keyId the ID of the key to use for encryption
* @param input the input data to encrypt
* @param iv the initialization vector to use for encryption
- * @return status the status of the call. The status must be one of
- * ERROR_DRM_SESSION_NOT_OPENED if the session is not opened,
+ * @return status the status of the call. The status must be OK or one of the
+ * following errors: ERROR_DRM_SESSION_NOT_OPENED if the session is not opened,
* BAD_VALUE if any parameters are invalid or ERROR_DRM_INVALID_STATE
- * if the HAL is in a state where the encrypt operation cannot be
- * performed.
+ * if the HAL is in a state where the encrypt operation cannot be performed.
* @return output the decrypted data
*/
encrypt(SessionId sessionId, vec<uint8_t> keyId, vec<uint8_t> input,
@@ -417,9 +422,9 @@
* @param keyId the ID of the key to use for decryption
* @param input the input data to decrypt
* @param iv the initialization vector to use for decryption
- * @return status the status of the call. The status must be one of
- * ERROR_DRM_SESSION_NOT_OPENED if the session is not opened,
- * BAD_VALUE if any parameters are invalid or ERROR_DRM_INVALID_STATE
+ * @return status the status of the call. The status must be OK or one of
+ * the following errors: ERROR_DRM_SESSION_NOT_OPENED if the session is not
+ * opened, BAD_VALUE if any parameters are invalid or ERROR_DRM_INVALID_STATE
* if the HAL is in a state where the decrypt operation cannot be
* performed.
* @return output the decrypted data
@@ -435,9 +440,9 @@
* @param sessionId the session id the call applies to
* @param keyId the ID of the key to use for decryption
* @param message the message to compute a signature over
- * @return status the status of the call. The status must be one of
- * ERROR_DRM_SESSION_NOT_OPENED if the session is not opened,
- * BAD_VALUE if any parameters are invalid or ERROR_DRM_INVALID_STATE
+ * @return status the status of the call. The status must be OK or one of
+ * the following errors: ERROR_DRM_SESSION_NOT_OPENED if the session is not
+ * opened, BAD_VALUE if any parameters are invalid or ERROR_DRM_INVALID_STATE
* if the HAL is in a state where the sign operation cannot be
* performed.
* @return signature the computed signature
@@ -454,9 +459,9 @@
* @param keyId the ID of the key to use for decryption
* @param message the message to compute a hash of
* @param signature the signature to verify
- * @return status the status of the call. The status must be one of
- * ERROR_DRM_SESSION_NOT_OPENED if the session is not opened,
- * BAD_VALUE if any parameters are invalid or ERROR_DRM_INVALID_STATE
+ * @return status the status of the call. The status must be OK or one of
+ * the following errors: ERROR_DRM_SESSION_NOT_OPENED if the session is not
+ * opened, BAD_VALUE if any parameters are invalid or ERROR_DRM_INVALID_STATE
* if the HAL is in a state where the verify operation cannot be
* performed.
* @return match true if the signature is verified positively,
@@ -475,11 +480,11 @@
* @param message the message to compute the signature on
* @param wrappedKey the private key returned during provisioning as
* returned by provideProvisionResponse.
- * @return status the status of the call. The status must be one of
- * ERROR_DRM_SESSION_NOT_OPENED if the session is not opened,
- * BAD_VALUE if any parameters are invalid or ERROR_DRM_INVALID_STATE
- * if the HAL is in a state where the signRSA operation cannot be
- * performed.
+ * @return status the status of the call. The status must be OK or one of
+ * the following errors: ERROR_DRM_SESSION_NOT_OPENED if the session is
+ * not opened, BAD_VALUE if any parameters are invalid or
+ * ERROR_DRM_INVALID_STATE if the HAL is in a state where the signRSA
+ * operation cannot be performed.
* @return signature the RSA signature computed over the message
*/
signRSA(SessionId sessionId, string algorithm, vec<uint8_t> message,
diff --git a/drm/drm/1.0/default/DrmFactory.cpp b/drm/drm/1.0/default/DrmFactory.cpp
index 7dc7ffe..f2d4a5a 100644
--- a/drm/drm/1.0/default/DrmFactory.cpp
+++ b/drm/drm/1.0/default/DrmFactory.cpp
@@ -40,6 +40,16 @@
return false;
}
+ Return<bool> DrmFactory::isContentTypeSupported (
+ const hidl_string& mimeType) {
+ for (size_t i = 0; i < loader.factoryCount(); i++) {
+ if (loader.getFactory(i)->isContentTypeSupported(String8(mimeType.c_str()))) {
+ return true;
+ }
+ }
+ return false;
+ }
+
Return<void> DrmFactory::createPlugin(const hidl_array<uint8_t, 16>& uuid,
createPlugin_cb _hidl_cb) {
diff --git a/drm/drm/1.0/default/DrmFactory.h b/drm/drm/1.0/default/DrmFactory.h
index 4dd9ac0..2b88d00 100644
--- a/drm/drm/1.0/default/DrmFactory.h
+++ b/drm/drm/1.0/default/DrmFactory.h
@@ -47,6 +47,9 @@
Return<bool> isCryptoSchemeSupported(const hidl_array<uint8_t, 16>& uuid)
override;
+ Return<bool> isContentTypeSupported(const hidl_string &mimeType)
+ override;
+
Return<void> createPlugin(const hidl_array<uint8_t, 16>& uuid,
createPlugin_cb _hidl_cb) override;
diff --git a/drm/drm/1.0/default/TypeConvert.cpp b/drm/drm/1.0/default/TypeConvert.cpp
index 2b4e2a2..4bed284 100644
--- a/drm/drm/1.0/default/TypeConvert.cpp
+++ b/drm/drm/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/drm/1.0/types.hal b/drm/drm/1.0/types.hal
index b2f3f32..e099418 100644
--- a/drm/drm/1.0/types.hal
+++ b/drm/drm/1.0/types.hal
@@ -18,6 +18,12 @@
enum Status : uint32_t {
/**
+ * The DRM plugin must return OK when an operation completes without any
+ * errors.
+ */
+ OK,
+
+ /**
* The DRM plugin must return ERROR_DRM_NO_LICENSE, when decryption is
* attempted and no license keys have been provided.
*/
@@ -122,7 +128,7 @@
enum KeyType : uint32_t {
/**
* Drm keys can be for offline content or for online streaming.
-
+ * Offline keys are persisted on the device and may be used when the device
* is disconnected from the network.
*/
OFFLINE,
diff --git a/vehicle/2.0/types.hal b/vehicle/2.0/types.hal
index d98a982..62521cb 100644
--- a/vehicle/2.0/types.hal
+++ b/vehicle/2.0/types.hal
@@ -1644,6 +1644,59 @@
| VehiclePropertyGroup:SYSTEM
| VehiclePropertyType:COMPLEX
| VehicleArea:GLOBAL),
+
+ /*
+ * OBD2 Live Sensor Data
+ *
+ * This property uses COMPLEX data to send a snapshot of the current (live)
+ * values of the OBD2 sensors provided by the vehicle.
+ *
+ * Its contents are to be interpreted as follows:
+ * the indices defined in Obd2IntegerSensorIndex are to be used to
+ * read from int32Values;
+ * the indices defined in Obd2FloatSensorIndex are to be used to
+ * read from floatValues.
+ *
+ * For example, int32Values[0] corresponds to FUEL_SYSTEM_STATUS, and
+ * floatValues[0] corresponds to CALCULATED_ENGINE_LOAD.
+ *
+ * @change_mode VehiclePropertyChangeMode:ON_CHANGE
+ * @access VehiclePropertyAccess:READ
+ */
+ OBD2_LIVE_FRAME = (
+ 0x0D00
+ | VehiclePropertyGroup:SYSTEM
+ | VehiclePropertyType:COMPLEX
+ | VehicleArea:GLOBAL),
+
+ /*
+ * OBD2 Freeze Frame Sensor Data
+ *
+ * This property uses COMPLEX data to send a snapshot of the values of the
+ * OBD2 sensors provided by the vehicle at the time that a diagnostic
+ * troubleshooting code (DTC) was recorded by the vehicle.
+ *
+ * Its contents are to be interpreted as follows:
+ * the indices defined in Obd2IntegerSensorIndex are to be used to
+ * read from int32Values;
+ * the indices defined in Obd2FloatSensorIndex are to be used to
+ * read from floatValues;
+ * stringValue is the DTC that caused this freeze frame to be recorded.
+ *
+ * For example, int32Values[0] corresponds to FUEL_SYSTEM_STATUS, and
+ * floatValues[0] corresponds to CALCULATED_ENGINE_LOAD, and a possible
+ * valid stringValue is "P0176" to indicate a malfunction of the fuel
+ * composition sensor circuit.
+ *
+ * @change_mode VehiclePropertyChangeMode:ON_CHANGE
+ * @access VehiclePropertyAccess:READ
+ */
+ OBD2_FREEZE_FRAME = (
+ 0x0D01
+ | VehiclePropertyGroup:SYSTEM
+ | VehiclePropertyType:COMPLEX
+ | VehicleArea:GLOBAL),
+
};
/*
diff --git a/vehicle/2.0/vts/functional/vts/testcases/hal/vehicle/hidl/host/VehicleHidlTest.py b/vehicle/2.0/vts/functional/vts/testcases/hal/vehicle/hidl/host/VehicleHidlTest.py
index 8da36d1..37f24c4 100644
--- a/vehicle/2.0/vts/functional/vts/testcases/hal/vehicle/hidl/host/VehicleHidlTest.py
+++ b/vehicle/2.0/vts/functional/vts/testcases/hal/vehicle/hidl/host/VehicleHidlTest.py
@@ -44,6 +44,7 @@
target_version=2.0,
target_package="android.hardware.vehicle",
target_component_name="IVehicle",
+ hw_binder_service_name="Vehicle",
bits=64)
def tearDownClass(self):
diff --git a/vr/1.0/vts/functional/Android.bp b/vr/1.0/vts/functional/Android.bp
index 2929fe7..551f27c 100644
--- a/vr/1.0/vts/functional/Android.bp
+++ b/vr/1.0/vts/functional/Android.bp
@@ -26,7 +26,11 @@
],
static_libs: ["libgtest"],
cflags: [
- "-O0",
+ "--coverage",
+ "-O0",
"-g",
],
+ ldflags: [
+ "--coverage"
+ ]
}
diff --git a/vr/1.0/vts/functional/vts/testcases/hal/vr/hidl/host/Android.mk b/vr/1.0/vts/functional/vts/testcases/hal/vr/hidl/host/Android.mk
new file mode 100644
index 0000000..9388b8d
--- /dev/null
+++ b/vr/1.0/vts/functional/vts/testcases/hal/vr/hidl/host/Android.mk
@@ -0,0 +1,23 @@
+#
+# Copyright (C) 2016 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.
+#
+
+LOCAL_PATH := $(call my-dir)
+
+include $(CLEAR_VARS)
+
+LOCAL_MODULE := VrHidlTest
+VTS_CONFIG_SRC_DIR := testcases/hal/vr/hidl/host
+include test/vts/tools/build/Android.host_config.mk
diff --git a/vr/1.0/vts/functional/vts/testcases/hal/vr/hidl/host/AndroidTest.xml b/vr/1.0/vts/functional/vts/testcases/hal/vr/hidl/host/AndroidTest.xml
new file mode 100644
index 0000000..1cd2a80
--- /dev/null
+++ b/vr/1.0/vts/functional/vts/testcases/hal/vr/hidl/host/AndroidTest.xml
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2016 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.
+-->
+<configuration description="Config for VTS HAL VR test cases">
+ <target_preparer class="com.android.compatibility.common.tradefed.targetprep.VtsFilePusher">
+ <option name="push-group" value="HidlHalTest.push" />
+ <option name="cleanup" value="true" />
+ <option name="push" value="spec/hardware/interfaces/vr/1.0/vts/Vr.vts->/data/local/tmp/spec/Vr.vts" />
+ </target_preparer>
+ <target_preparer class="com.android.tradefed.targetprep.VtsPythonVirtualenvPreparer" />
+ <test class="com.android.tradefed.testtype.VtsMultiDeviceTest">
+ <option name="test-module-name" value="VrHidlTest" />
+ <option name="test-case-path" value="vts/testcases/hal/vr/hidl/host/VrHidlTest" />
+ </test>
+</configuration>
diff --git a/vr/1.0/vts/functional/vts/testcases/hal/vr/hidl/host/VrHidlTest.py b/vr/1.0/vts/functional/vts/testcases/hal/vr/hidl/host/VrHidlTest.py
new file mode 100644
index 0000000..9ed378f
--- /dev/null
+++ b/vr/1.0/vts/functional/vts/testcases/hal/vr/hidl/host/VrHidlTest.py
@@ -0,0 +1,80 @@
+#!/usr/bin/env python3.4
+#
+# Copyright (C) 2016 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.
+#
+
+import logging
+import time
+
+from vts.runners.host import asserts
+from vts.runners.host import base_test_with_webdb
+from vts.runners.host import test_runner
+from vts.utils.python.controllers import android_device
+from vts.utils.python.profiling import profiling_utils
+
+
+class VrHidlTest(base_test_with_webdb.BaseTestWithWebDbClass):
+ """A simple testcase for the VR HIDL HAL."""
+
+ def setUpClass(self):
+ """Creates a mirror and turns on the framework-layer VR service."""
+ self.dut = self.registerController(android_device)[0]
+
+ self.dut.shell.InvokeTerminal("one")
+ self.dut.shell.one.Execute("setenforce 0") # SELinux permissive mode
+
+ # Test using the binderized mode
+ self.dut.shell.one.Execute(
+ "setprop vts.hal.vts.hidl.get_stub true")
+
+ if self.enable_profiling:
+ profiling_utils.EnableVTSProfiling(self.dut.shell.one)
+
+ self.dut.hal.InitHidlHal(
+ target_type="vr",
+ target_basepaths=["/system/lib64"],
+ target_version=1.0,
+ target_package="android.hardware.vr",
+ target_component_name="IVr",
+ bits=64)
+
+ def tearDownClass(self):
+ """ If profiling is enabled for the test, collect the profiling data
+ and disable profiling after the test is done.
+ """
+ if self.enable_profiling:
+ profiling_trace_path = getattr(
+ self, self.VTS_PROFILING_TRACING_PATH, "")
+ self.ProcessAndUploadTraceData(self.dut, profiling_trace_path)
+ profiling_utils.DisableVTSProfiling(self.dut.shell.one)
+
+ def testVrBasic(self):
+ """A simple test case which just calls each registered function."""
+ result = self.dut.hal.vr.init()
+ logging.info("init result: %s", result)
+
+ time.sleep(1)
+
+ result = self.dut.hal.vr.setVrMode(True)
+ logging.info("setVrMode(true) result: %s", result)
+
+ time.sleep(1)
+
+ result = self.dut.hal.vr.setVrMode(False)
+ logging.info("setVrMode(false) result: %s", result)
+
+
+if __name__ == "__main__":
+ test_runner.main()
diff --git a/vr/1.0/vts/functional/vts/testcases/hal/vr/hidl/host/__init__.py b/vr/1.0/vts/functional/vts/testcases/hal/vr/hidl/host/__init__.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/vr/1.0/vts/functional/vts/testcases/hal/vr/hidl/host/__init__.py
diff --git a/vr/1.0/vts/functional/vts/testcases/hal/vr/hidl/target/AndroidTest.xml b/vr/1.0/vts/functional/vts/testcases/hal/vr/hidl/target/AndroidTest.xml
index a29c23b..888a585 100644
--- a/vr/1.0/vts/functional/vts/testcases/hal/vr/hidl/target/AndroidTest.xml
+++ b/vr/1.0/vts/functional/vts/testcases/hal/vr/hidl/target/AndroidTest.xml
@@ -26,6 +26,7 @@
"/>
<option name="binary-test-type" value="gtest" />
<option name="test-timeout" value="1m" />
- </test>
+ <option name="test-config-path" value="vts/testcases/hal/vr/hidl/target/VrHidlTargetTest.config" />
+</test>
</configuration>
diff --git a/vr/1.0/vts/functional/vts/testcases/hal/vr/hidl/target/VrHidlTargetTest.config b/vr/1.0/vts/functional/vts/testcases/hal/vr/hidl/target/VrHidlTargetTest.config
new file mode 100644
index 0000000..ec01b5f
--- /dev/null
+++ b/vr/1.0/vts/functional/vts/testcases/hal/vr/hidl/target/VrHidlTargetTest.config
@@ -0,0 +1,25 @@
+{
+ "use_gae_db": true,
+ "coverage": true,
+ "modules": [{
+ "module_name": "system/lib64/hw/vr.marlin",
+ "git_project": {
+ "name": "device/google/marlin",
+ "path": "device/google/marlin"
+ }
+ },
+ {
+ "module_name": "system/lib64/hw/vr.sailfish",
+ "git_project": {
+ "name": "device/google/marlin",
+ "path": "device/google/marlin"
+ }
+ },
+ {
+ "module_name": "system/lib64/hw/android.hardware.vr@1.0-impl",
+ "git_project": {
+ "name": "platform/hardware/interfaces",
+ "path": "hardware/interfaces"
+ }
+ }]
+}