Correction to logging when SRM version is queried
[ Merge of http://go/wvgerrit/72703 ] SRM is an optional feature and whether it is implemented is upto the discretion of OEMs. If it is not, avoid logging this information. Bug: 124391178 Test: WV unit/integration tests Change-Id: If8d2b1e0b59fb11825f832a5d4259b03c482fd6b
This commit is contained in:
@@ -87,6 +87,7 @@ static const std::string QUERY_KEY_DECRYPT_HASH_SUPPORT =
|
|||||||
|
|
||||||
static const std::string QUERY_VALUE_TRUE = "True";
|
static const std::string QUERY_VALUE_TRUE = "True";
|
||||||
static const std::string QUERY_VALUE_FALSE = "False";
|
static const std::string QUERY_VALUE_FALSE = "False";
|
||||||
|
static const std::string QUERY_VALUE_NONE = "None";
|
||||||
static const std::string QUERY_VALUE_STREAMING = "Streaming";
|
static const std::string QUERY_VALUE_STREAMING = "Streaming";
|
||||||
static const std::string QUERY_VALUE_OFFLINE = "Offline";
|
static const std::string QUERY_VALUE_OFFLINE = "Offline";
|
||||||
static const std::string QUERY_VALUE_SECURITY_LEVEL_L1 = "L1";
|
static const std::string QUERY_VALUE_SECURITY_LEVEL_L1 = "L1";
|
||||||
|
|||||||
@@ -631,7 +631,10 @@ CdmResponseType CdmEngine::QueryStatus(SecurityLevel security_level,
|
|||||||
} else if (query_token == QUERY_KEY_CURRENT_SRM_VERSION) {
|
} else if (query_token == QUERY_KEY_CURRENT_SRM_VERSION) {
|
||||||
uint16_t current_srm_version;
|
uint16_t current_srm_version;
|
||||||
status = crypto_session->GetSrmVersion(¤t_srm_version);
|
status = crypto_session->GetSrmVersion(¤t_srm_version);
|
||||||
if (status != NO_ERROR) {
|
if (status == NOT_IMPLEMENTED_ERROR) {
|
||||||
|
*query_response = QUERY_VALUE_NONE;
|
||||||
|
return NO_ERROR;
|
||||||
|
} else if (status != NO_ERROR) {
|
||||||
LOGW("CdmEngine::QueryStatus: GetCurrentSRMVersion failed: %d", status);
|
LOGW("CdmEngine::QueryStatus: GetCurrentSRMVersion failed: %d", status);
|
||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1856,6 +1856,14 @@ CdmResponseType CryptoSession::GetSrmVersion(uint16_t* srm_version) {
|
|||||||
|
|
||||||
OEMCryptoResult status = OEMCrypto_GetCurrentSRMVersion(srm_version);
|
OEMCryptoResult status = OEMCrypto_GetCurrentSRMVersion(srm_version);
|
||||||
|
|
||||||
|
// SRM is an optional feature. Whether it is implemented is up to the
|
||||||
|
// discretion of OEMs
|
||||||
|
if (status == OEMCrypto_ERROR_NOT_IMPLEMENTED) {
|
||||||
|
LOGV("CryptoSession::GetSrmVersion: OEMCrypto_GetCurrentSRMVersion not "
|
||||||
|
"implemented");
|
||||||
|
return NOT_IMPLEMENTED_ERROR;
|
||||||
|
}
|
||||||
|
|
||||||
return MapOEMCryptoResult(
|
return MapOEMCryptoResult(
|
||||||
status, GET_SRM_VERSION_ERROR, "GetCurrentSRMVersion");
|
status, GET_SRM_VERSION_ERROR, "GetCurrentSRMVersion");
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4380,6 +4380,11 @@ TEST_F(WvCdmRequestLicenseTest, QueryStatus) {
|
|||||||
wvcdm::QUERY_KEY_OEMCRYPTO_BUILD_INFORMATION,
|
wvcdm::QUERY_KEY_OEMCRYPTO_BUILD_INFORMATION,
|
||||||
&value));
|
&value));
|
||||||
EXPECT_TRUE(!value.empty());
|
EXPECT_TRUE(!value.empty());
|
||||||
|
|
||||||
|
EXPECT_EQ(wvcdm::NO_ERROR,
|
||||||
|
decryptor_.QueryStatus(kLevelDefault,
|
||||||
|
wvcdm::QUERY_KEY_CURRENT_SRM_VERSION,
|
||||||
|
&value));
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST_F(WvCdmRequestLicenseTest, QueryStatusL3) {
|
TEST_F(WvCdmRequestLicenseTest, QueryStatusL3) {
|
||||||
|
|||||||
Reference in New Issue
Block a user