Rename ReleaseAllUsageInfo to RemoveAllUsageInfo
[ Merge of http://go/wvgerrit/44920 ] Bug: 69674645 Test: WV unit and integration tests Change-Id: Iee6e60b9dd20a8ed087c5e44924aa1c05f640920
This commit is contained in:
@@ -212,13 +212,13 @@ class CdmEngine {
|
|||||||
const CdmSecureStopId& ssid,
|
const CdmSecureStopId& ssid,
|
||||||
CdmUsageInfo* usage_info);
|
CdmUsageInfo* usage_info);
|
||||||
|
|
||||||
// Release all usage records for the current origin.
|
// Remove all usage records for the current origin.
|
||||||
virtual CdmResponseType ReleaseAllUsageInfo(const std::string& app_id,
|
virtual CdmResponseType RemoveAllUsageInfo(const std::string& app_id,
|
||||||
CdmSecurityLevel security_level);
|
CdmSecurityLevel security_level);
|
||||||
|
|
||||||
// Release all usage records for the current origin. Span all
|
// Remove all usage records for the current origin. Span all
|
||||||
// security levels.
|
// security levels.
|
||||||
virtual CdmResponseType ReleaseAllUsageInfo(const std::string& app_id);
|
virtual CdmResponseType RemoveAllUsageInfo(const std::string& app_id);
|
||||||
|
|
||||||
virtual CdmResponseType ReleaseUsageInfo(
|
virtual CdmResponseType ReleaseUsageInfo(
|
||||||
const CdmUsageInfoReleaseMessage& message);
|
const CdmUsageInfoReleaseMessage& message);
|
||||||
|
|||||||
@@ -140,8 +140,8 @@ enum CdmResponseType {
|
|||||||
LOAD_KEY_ERROR = 99,
|
LOAD_KEY_ERROR = 99,
|
||||||
NO_CONTENT_KEY = 100,
|
NO_CONTENT_KEY = 100,
|
||||||
REFRESH_KEYS_ERROR = 101,
|
REFRESH_KEYS_ERROR = 101,
|
||||||
RELEASE_ALL_USAGE_INFO_ERROR_1 = 102,
|
REMOVE_ALL_USAGE_INFO_ERROR_1 = 102,
|
||||||
RELEASE_ALL_USAGE_INFO_ERROR_2 = 103,
|
REMOVE_ALL_USAGE_INFO_ERROR_2 = 103,
|
||||||
RELEASE_KEY_ERROR = 104,
|
RELEASE_KEY_ERROR = 104,
|
||||||
RELEASE_KEY_REQUEST_ERROR = 105,
|
RELEASE_KEY_REQUEST_ERROR = 105,
|
||||||
RELEASE_LICENSE_ERROR_1 = 106,
|
RELEASE_LICENSE_ERROR_1 = 106,
|
||||||
@@ -289,8 +289,8 @@ enum CdmResponseType {
|
|||||||
USAGE_STORE_LICENSE_FAILED = 247,
|
USAGE_STORE_LICENSE_FAILED = 247,
|
||||||
USAGE_STORE_USAGE_INFO_FAILED = 248,
|
USAGE_STORE_USAGE_INFO_FAILED = 248,
|
||||||
USAGE_INVALID_LOAD_ENTRY = 249,
|
USAGE_INVALID_LOAD_ENTRY = 249,
|
||||||
RELEASE_ALL_USAGE_INFO_ERROR_4 = 250,
|
REMOVE_ALL_USAGE_INFO_ERROR_4 = 250,
|
||||||
RELEASE_ALL_USAGE_INFO_ERROR_5 = 251,
|
REMOVE_ALL_USAGE_INFO_ERROR_5 = 251,
|
||||||
RELEASE_USAGE_INFO_FAILED = 252,
|
RELEASE_USAGE_INFO_FAILED = 252,
|
||||||
INCORRECT_USAGE_SUPPORT_TYPE_1 = 253,
|
INCORRECT_USAGE_SUPPORT_TYPE_1 = 253,
|
||||||
INCORRECT_USAGE_SUPPORT_TYPE_2 = 254,
|
INCORRECT_USAGE_SUPPORT_TYPE_2 = 254,
|
||||||
@@ -314,13 +314,16 @@ enum CdmResponseType {
|
|||||||
USAGE_STORE_ENTRY_RETRIEVE_LICENSE_FAILED = 272,
|
USAGE_STORE_ENTRY_RETRIEVE_LICENSE_FAILED = 272,
|
||||||
USAGE_STORE_ENTRY_RETRIEVE_USAGE_INFO_FAILED = 273,
|
USAGE_STORE_ENTRY_RETRIEVE_USAGE_INFO_FAILED = 273,
|
||||||
USAGE_STORE_ENTRY_RETRIEVE_INVALID_STORAGE_TYPE = 274,
|
USAGE_STORE_ENTRY_RETRIEVE_INVALID_STORAGE_TYPE = 274,
|
||||||
RELEASE_ALL_USAGE_INFO_ERROR_6 = 275,
|
REMOVE_ALL_USAGE_INFO_ERROR_6 = 275,
|
||||||
RELEASE_ALL_USAGE_INFO_ERROR_7 = 276,
|
REMOVE_ALL_USAGE_INFO_ERROR_7 = 276,
|
||||||
LICENSE_REQUEST_INVALID_SUBLICENSE = 277,
|
LICENSE_REQUEST_INVALID_SUBLICENSE = 277,
|
||||||
CERT_PROVISIONING_EMPTY_SERVICE_CERTIFICATE = 278,
|
CERT_PROVISIONING_EMPTY_SERVICE_CERTIFICATE = 278,
|
||||||
LOAD_SYSTEM_ID_ERROR = 279,
|
LOAD_SYSTEM_ID_ERROR = 279,
|
||||||
INSUFFICIENT_CRYPTO_RESOURCES_4 = 280,
|
INSUFFICIENT_CRYPTO_RESOURCES_4 = 280,
|
||||||
INSUFFICIENT_CRYPTO_RESOURCES_5 = 281,
|
INSUFFICIENT_CRYPTO_RESOURCES_5 = 281,
|
||||||
|
REMOVE_USAGE_INFO_ERROR_1 = 282,
|
||||||
|
REMOVE_USAGE_INFO_ERROR_2 = 283,
|
||||||
|
REMOVE_USAGE_INFO_ERROR_3 = 284,
|
||||||
};
|
};
|
||||||
|
|
||||||
enum CdmKeyStatus {
|
enum CdmKeyStatus {
|
||||||
|
|||||||
@@ -1156,17 +1156,17 @@ CdmResponseType CdmEngine::GetUsageInfo(const std::string& app_id,
|
|||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
|
|
||||||
CdmResponseType CdmEngine::ReleaseAllUsageInfo(
|
CdmResponseType CdmEngine::RemoveAllUsageInfo(
|
||||||
const std::string& app_id, CdmSecurityLevel security_level) {
|
const std::string& app_id, CdmSecurityLevel security_level) {
|
||||||
DeviceFiles handle(file_system_);
|
DeviceFiles handle(file_system_);
|
||||||
if (!handle.Init(security_level)) {
|
if (!handle.Init(security_level)) {
|
||||||
LOGE("CdmEngine::ReleaseAllUsageInfo: unable to initialize device files");
|
LOGE("CdmEngine::RemoveAllUsageInfo: unable to initialize device files");
|
||||||
return RELEASE_ALL_USAGE_INFO_ERROR_6;
|
return REMOVE_ALL_USAGE_INFO_ERROR_6;
|
||||||
}
|
}
|
||||||
std::vector<std::string> provider_session_tokens;
|
std::vector<std::string> provider_session_tokens;
|
||||||
if (!handle.DeleteAllUsageInfoForApp(app_id, &provider_session_tokens)) {
|
if (!handle.DeleteAllUsageInfoForApp(app_id, &provider_session_tokens)) {
|
||||||
LOGE("CdmEngine::ReleaseAllUsageInfo: failed to delete usage records");
|
LOGE("CdmEngine::RemoveAllUsageInfo: failed to delete usage records");
|
||||||
return RELEASE_ALL_USAGE_INFO_ERROR_7;
|
return REMOVE_ALL_USAGE_INFO_ERROR_7;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (provider_session_tokens.size() == 0UL) {
|
if (provider_session_tokens.size() == 0UL) {
|
||||||
@@ -1183,12 +1183,12 @@ CdmResponseType CdmEngine::ReleaseAllUsageInfo(
|
|||||||
DeleteMultipleUsageInformation(provider_session_tokens);
|
DeleteMultipleUsageInformation(provider_session_tokens);
|
||||||
}
|
}
|
||||||
if (status != NO_ERROR) {
|
if (status != NO_ERROR) {
|
||||||
LOGE("CdmEngine::ReleaseAllUsageInfo: CryptoSession failure");
|
LOGE("CdmEngine::RemoveAllUsageInfo: CryptoSession failure");
|
||||||
}
|
}
|
||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
|
|
||||||
CdmResponseType CdmEngine::ReleaseAllUsageInfo(const std::string& app_id) {
|
CdmResponseType CdmEngine::RemoveAllUsageInfo(const std::string& app_id) {
|
||||||
if (NULL == usage_property_set_.get()) {
|
if (NULL == usage_property_set_.get()) {
|
||||||
usage_property_set_.reset(new UsagePropertySet());
|
usage_property_set_.reset(new UsagePropertySet());
|
||||||
}
|
}
|
||||||
@@ -1216,7 +1216,7 @@ CdmResponseType CdmEngine::ReleaseAllUsageInfo(const std::string& app_id) {
|
|||||||
if (!handle.RetrieveUsageInfo(
|
if (!handle.RetrieveUsageInfo(
|
||||||
DeviceFiles::GetUsageInfoFileName(app_id),
|
DeviceFiles::GetUsageInfoFileName(app_id),
|
||||||
&usage_data)) {
|
&usage_data)) {
|
||||||
status = RELEASE_ALL_USAGE_INFO_ERROR_4;
|
status = REMOVE_ALL_USAGE_INFO_ERROR_4;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1230,7 +1230,7 @@ CdmResponseType CdmEngine::ReleaseAllUsageInfo(const std::string& app_id) {
|
|||||||
if (!handle.DeleteUsageInfo(
|
if (!handle.DeleteUsageInfo(
|
||||||
DeviceFiles::GetUsageInfoFileName(app_id),
|
DeviceFiles::GetUsageInfoFileName(app_id),
|
||||||
usage_data[0].provider_session_token)) {
|
usage_data[0].provider_session_token)) {
|
||||||
status = RELEASE_ALL_USAGE_INFO_ERROR_6;
|
status = REMOVE_ALL_USAGE_INFO_ERROR_6;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
} while (status == NO_ERROR && !usage_data.empty());
|
} while (status == NO_ERROR && !usage_data.empty());
|
||||||
@@ -1239,7 +1239,7 @@ CdmResponseType CdmEngine::ReleaseAllUsageInfo(const std::string& app_id) {
|
|||||||
if (!handle.DeleteAllUsageInfoForApp(
|
if (!handle.DeleteAllUsageInfoForApp(
|
||||||
DeviceFiles::GetUsageInfoFileName(app_id),
|
DeviceFiles::GetUsageInfoFileName(app_id),
|
||||||
&provider_session_tokens)) {
|
&provider_session_tokens)) {
|
||||||
status = RELEASE_ALL_USAGE_INFO_ERROR_5;
|
status = REMOVE_ALL_USAGE_INFO_ERROR_5;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -1248,9 +1248,9 @@ CdmResponseType CdmEngine::ReleaseAllUsageInfo(const std::string& app_id) {
|
|||||||
if (!handle.DeleteAllUsageInfoForApp(
|
if (!handle.DeleteAllUsageInfoForApp(
|
||||||
DeviceFiles::GetUsageInfoFileName(app_id),
|
DeviceFiles::GetUsageInfoFileName(app_id),
|
||||||
&provider_session_tokens)) {
|
&provider_session_tokens)) {
|
||||||
LOGE("CdmEngine::ReleaseAllUsageInfo: failed to delete %d secure"
|
LOGE("CdmEngine::RemoveAllUsageInfo: failed to delete %d secure"
|
||||||
"stops", j);
|
"stops", j);
|
||||||
status = RELEASE_ALL_USAGE_INFO_ERROR_1;
|
status = REMOVE_ALL_USAGE_INFO_ERROR_1;
|
||||||
} else {
|
} else {
|
||||||
CdmResponseType status2 = usage_session_->
|
CdmResponseType status2 = usage_session_->
|
||||||
DeleteMultipleUsageInformation(provider_session_tokens);
|
DeleteMultipleUsageInformation(provider_session_tokens);
|
||||||
@@ -1263,9 +1263,9 @@ CdmResponseType CdmEngine::ReleaseAllUsageInfo(const std::string& app_id) {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
LOGE("CdmEngine::ReleaseAllUsageInfo: failed to initialize L%d device"
|
LOGE("CdmEngine::RemoveAllUsageInfo: failed to initialize L%d device"
|
||||||
"files", j);
|
"files", j);
|
||||||
status = RELEASE_ALL_USAGE_INFO_ERROR_2;
|
status = REMOVE_ALL_USAGE_INFO_ERROR_2;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
usage_session_.reset(NULL);
|
usage_session_.reset(NULL);
|
||||||
|
|||||||
@@ -221,23 +221,23 @@ void PrintTo(const enum CdmResponseType& value, ::std::ostream* os) {
|
|||||||
break;
|
break;
|
||||||
case REFRESH_KEYS_ERROR: *os << "REFRESH_KEYS_ERROR";
|
case REFRESH_KEYS_ERROR: *os << "REFRESH_KEYS_ERROR";
|
||||||
break;
|
break;
|
||||||
case RELEASE_ALL_USAGE_INFO_ERROR_1:
|
case REMOVE_ALL_USAGE_INFO_ERROR_1:
|
||||||
*os << "RELEASE_ALL_USAGE_INFO_ERROR_1";
|
*os << "REMOVE_ALL_USAGE_INFO_ERROR_1";
|
||||||
break;
|
break;
|
||||||
case RELEASE_ALL_USAGE_INFO_ERROR_2:
|
case REMOVE_ALL_USAGE_INFO_ERROR_2:
|
||||||
*os << "RELEASE_ALL_USAGE_INFO_ERROR_2";
|
*os << "REMOVE_ALL_USAGE_INFO_ERROR_2";
|
||||||
break;
|
break;
|
||||||
case RELEASE_ALL_USAGE_INFO_ERROR_4:
|
case REMOVE_ALL_USAGE_INFO_ERROR_4:
|
||||||
*os << "RELEASE_ALL_USAGE_INFO_ERROR_4";
|
*os << "REMOVE_ALL_USAGE_INFO_ERROR_4";
|
||||||
break;
|
break;
|
||||||
case RELEASE_ALL_USAGE_INFO_ERROR_5:
|
case REMOVE_ALL_USAGE_INFO_ERROR_5:
|
||||||
*os << "RELEASE_ALL_USAGE_INFO_ERROR_5";
|
*os << "REMOVE_ALL_USAGE_INFO_ERROR_5";
|
||||||
break;
|
break;
|
||||||
case RELEASE_ALL_USAGE_INFO_ERROR_6:
|
case REMOVE_ALL_USAGE_INFO_ERROR_6:
|
||||||
*os << "RELEASE_ALL_USAGE_INFO_ERROR_6";
|
*os << "REMOVE_ALL_USAGE_INFO_ERROR_6";
|
||||||
break;
|
break;
|
||||||
case RELEASE_ALL_USAGE_INFO_ERROR_7:
|
case REMOVE_ALL_USAGE_INFO_ERROR_7:
|
||||||
*os << "RELEASE_ALL_USAGE_INFO_ERROR_7";
|
*os << "REMOVE_ALL_USAGE_INFO_ERROR_7";
|
||||||
break;
|
break;
|
||||||
case RELEASE_KEY_ERROR: *os << "RELEASE_KEY_ERROR";
|
case RELEASE_KEY_ERROR: *os << "RELEASE_KEY_ERROR";
|
||||||
break;
|
break;
|
||||||
@@ -578,6 +578,12 @@ void PrintTo(const enum CdmResponseType& value, ::std::ostream* os) {
|
|||||||
case INSUFFICIENT_CRYPTO_RESOURCES_5:
|
case INSUFFICIENT_CRYPTO_RESOURCES_5:
|
||||||
*os << "INSUFFICIENT_CRYPTO_RESOURCES_5";
|
*os << "INSUFFICIENT_CRYPTO_RESOURCES_5";
|
||||||
break;
|
break;
|
||||||
|
case REMOVE_USAGE_INFO_ERROR_1: *os << "REMOVE_USAGE_INFO_ERROR_1";
|
||||||
|
break;
|
||||||
|
case REMOVE_USAGE_INFO_ERROR_2: *os << "REMOVE_USAGE_INFO_ERROR_2";
|
||||||
|
break;
|
||||||
|
case REMOVE_USAGE_INFO_ERROR_3: *os << "REMOVE_USAGE_INFO_ERROR_3";
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
*os << "Unknown CdmResponseType";
|
*os << "Unknown CdmResponseType";
|
||||||
break;
|
break;
|
||||||
|
|||||||
@@ -105,8 +105,8 @@ class WvContentDecryptionModule : public android::RefBase, public TimerHandler {
|
|||||||
const CdmSecureStopId& ssid,
|
const CdmSecureStopId& ssid,
|
||||||
const CdmIdentifier& identifier,
|
const CdmIdentifier& identifier,
|
||||||
CdmUsageInfo* usage_info);
|
CdmUsageInfo* usage_info);
|
||||||
virtual CdmResponseType ReleaseAllUsageInfo(const std::string& app_id,
|
virtual CdmResponseType RemoveAllUsageInfo(const std::string& app_id,
|
||||||
const CdmIdentifier& identifier);
|
const CdmIdentifier& identifier);
|
||||||
virtual CdmResponseType ReleaseUsageInfo(
|
virtual CdmResponseType ReleaseUsageInfo(
|
||||||
const CdmUsageInfoReleaseMessage& message,
|
const CdmUsageInfoReleaseMessage& message,
|
||||||
const CdmIdentifier& identifier);
|
const CdmIdentifier& identifier);
|
||||||
|
|||||||
@@ -279,8 +279,10 @@ class EngineMetrics {
|
|||||||
CounterMetric<CdmResponseType> cdm_engine_open_key_set_session_;
|
CounterMetric<CdmResponseType> cdm_engine_open_key_set_session_;
|
||||||
CounterMetric<CdmResponseType> cdm_engine_open_session_;
|
CounterMetric<CdmResponseType> cdm_engine_open_session_;
|
||||||
EventMetric<CdmResponseType> cdm_engine_query_key_status_;
|
EventMetric<CdmResponseType> cdm_engine_query_key_status_;
|
||||||
CounterMetric<CdmResponseType> cdm_engine_release_all_usage_info_;
|
CounterMetric<CdmResponseType> cdm_engine_remove_all_usage_info_;
|
||||||
|
CounterMetric<CdmResponseType> cdm_engine_remove_usage_info_;
|
||||||
CounterMetric<CdmResponseType> cdm_engine_release_usage_info_;
|
CounterMetric<CdmResponseType> cdm_engine_release_usage_info_;
|
||||||
|
CounterMetric<CdmResponseType> cdm_engine_get_secure_stop_ids_;
|
||||||
CounterMetric<CdmResponseType> cdm_engine_remove_keys_;
|
CounterMetric<CdmResponseType> cdm_engine_remove_keys_;
|
||||||
EventMetric<CdmResponseType> cdm_engine_restore_key_;
|
EventMetric<CdmResponseType> cdm_engine_restore_key_;
|
||||||
CounterMetric<CdmResponseType, CdmSecurityLevel> cdm_engine_unprovision_;
|
CounterMetric<CdmResponseType, CdmSecurityLevel> cdm_engine_unprovision_;
|
||||||
|
|||||||
@@ -420,12 +420,18 @@ EngineMetrics::EngineMetrics() :
|
|||||||
cdm_engine_query_key_status_(
|
cdm_engine_query_key_status_(
|
||||||
"/drm/widevine/cdm_engine/query_key_status/time",
|
"/drm/widevine/cdm_engine/query_key_status/time",
|
||||||
"error"),
|
"error"),
|
||||||
cdm_engine_release_all_usage_info_(
|
cdm_engine_remove_all_usage_info_(
|
||||||
"/drm/widevine/cdm_engine/release_all_usage_info",
|
"/drm/widevine/cdm_engine/remove_all_usage_info",
|
||||||
|
"error"),
|
||||||
|
cdm_engine_remove_usage_info_(
|
||||||
|
"/drm/widevine/cdm_engine/remove_usage_info",
|
||||||
"error"),
|
"error"),
|
||||||
cdm_engine_release_usage_info_(
|
cdm_engine_release_usage_info_(
|
||||||
"/drm/widevine/cdm_engine/release_usage_info",
|
"/drm/widevine/cdm_engine/release_usage_info",
|
||||||
"error"),
|
"error"),
|
||||||
|
cdm_engine_get_secure_stop_ids_(
|
||||||
|
"/drm/widevine/cdm_engine/get_secure_stop_ids",
|
||||||
|
"error"),
|
||||||
cdm_engine_remove_keys_(
|
cdm_engine_remove_keys_(
|
||||||
"/drm/widevine/cdm_engine/remove_keys",
|
"/drm/widevine/cdm_engine/remove_keys",
|
||||||
"error"),
|
"error"),
|
||||||
@@ -524,8 +530,10 @@ void EngineMetrics::SerializeEngineMetrics(MetricsGroup* metric_group) {
|
|||||||
cdm_engine_open_key_set_session_.Serialize(&serializer);
|
cdm_engine_open_key_set_session_.Serialize(&serializer);
|
||||||
cdm_engine_open_session_.Serialize(&serializer);
|
cdm_engine_open_session_.Serialize(&serializer);
|
||||||
cdm_engine_query_key_status_.Serialize(&serializer);
|
cdm_engine_query_key_status_.Serialize(&serializer);
|
||||||
cdm_engine_release_all_usage_info_.Serialize(&serializer);
|
cdm_engine_remove_all_usage_info_.Serialize(&serializer);
|
||||||
|
cdm_engine_remove_usage_info_.Serialize(&serializer);
|
||||||
cdm_engine_release_usage_info_.Serialize(&serializer);
|
cdm_engine_release_usage_info_.Serialize(&serializer);
|
||||||
|
cdm_engine_get_secure_stop_ids_.Serialize(&serializer);
|
||||||
cdm_engine_remove_keys_.Serialize(&serializer);
|
cdm_engine_remove_keys_.Serialize(&serializer);
|
||||||
cdm_engine_restore_key_.Serialize(&serializer);
|
cdm_engine_restore_key_.Serialize(&serializer);
|
||||||
cdm_engine_unprovision_.Serialize(&serializer);
|
cdm_engine_unprovision_.Serialize(&serializer);
|
||||||
|
|||||||
@@ -297,11 +297,11 @@ CdmResponseType WvContentDecryptionModule::GetUsageInfo(
|
|||||||
return sts;
|
return sts;
|
||||||
}
|
}
|
||||||
|
|
||||||
CdmResponseType WvContentDecryptionModule::ReleaseAllUsageInfo(
|
CdmResponseType WvContentDecryptionModule::RemoveAllUsageInfo(
|
||||||
const std::string& app_id, const CdmIdentifier& identifier) {
|
const std::string& app_id, const CdmIdentifier& identifier) {
|
||||||
CdmEngine* cdm_engine = EnsureCdmForIdentifier(identifier);
|
CdmEngine* cdm_engine = EnsureCdmForIdentifier(identifier);
|
||||||
CdmResponseType sts = cdm_engine->ReleaseAllUsageInfo(app_id);
|
CdmResponseType sts = cdm_engine->RemoveAllUsageInfo(app_id);
|
||||||
cdm_engine->GetMetrics()->cdm_engine_release_all_usage_info_.Increment(sts);
|
cdm_engine->GetMetrics()->cdm_engine_remove_all_usage_info_.Increment(sts);
|
||||||
return sts;
|
return sts;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -2956,7 +2956,7 @@ INSTANTIATE_TEST_CASE_P(Cdm, WvCdmUsageInfoTest,
|
|||||||
&usage_info_sub_sample_info[6],
|
&usage_info_sub_sample_info[6],
|
||||||
&usage_info_sub_sample_info[7]));
|
&usage_info_sub_sample_info[7]));
|
||||||
|
|
||||||
TEST_F(WvCdmRequestLicenseTest, UsageReleaseAllTest) {
|
TEST_F(WvCdmRequestLicenseTest, UsageRemoveAllTest) {
|
||||||
Unprovision();
|
Unprovision();
|
||||||
|
|
||||||
std::string app_id_empty = "";
|
std::string app_id_empty = "";
|
||||||
@@ -3025,7 +3025,7 @@ TEST_F(WvCdmRequestLicenseTest, UsageReleaseAllTest) {
|
|||||||
|
|
||||||
EXPECT_EQ(
|
EXPECT_EQ(
|
||||||
NO_ERROR,
|
NO_ERROR,
|
||||||
decryptor_.ReleaseAllUsageInfo(app_id_not_empty, kDefaultCdmIdentifier));
|
decryptor_.RemoveAllUsageInfo(app_id_not_empty, kDefaultCdmIdentifier));
|
||||||
|
|
||||||
EXPECT_EQ(
|
EXPECT_EQ(
|
||||||
NO_ERROR,
|
NO_ERROR,
|
||||||
@@ -3040,7 +3040,7 @@ TEST_F(WvCdmRequestLicenseTest, UsageReleaseAllTest) {
|
|||||||
|
|
||||||
EXPECT_EQ(
|
EXPECT_EQ(
|
||||||
NO_ERROR,
|
NO_ERROR,
|
||||||
decryptor_.ReleaseAllUsageInfo(app_id_empty, kDefaultCdmIdentifier));
|
decryptor_.RemoveAllUsageInfo(app_id_empty, kDefaultCdmIdentifier));
|
||||||
|
|
||||||
EXPECT_EQ(
|
EXPECT_EQ(
|
||||||
NO_ERROR,
|
NO_ERROR,
|
||||||
|
|||||||
@@ -99,8 +99,8 @@ enum {
|
|||||||
kNoContentKey = ERROR_DRM_VENDOR_MIN + 98,
|
kNoContentKey = ERROR_DRM_VENDOR_MIN + 98,
|
||||||
kProvisioningGetKeyboxError = ERROR_DRM_VENDOR_MIN + 99,
|
kProvisioningGetKeyboxError = ERROR_DRM_VENDOR_MIN + 99,
|
||||||
kRefreshKeysError = ERROR_DRM_VENDOR_MIN + 100,
|
kRefreshKeysError = ERROR_DRM_VENDOR_MIN + 100,
|
||||||
kReleaseAllUsageInfoError1 = ERROR_DRM_VENDOR_MIN + 101,
|
kRemoveAllUsageInfoError1 = ERROR_DRM_VENDOR_MIN + 101,
|
||||||
kReleaseAllUsageInfoError2 = ERROR_DRM_VENDOR_MIN + 102,
|
kRemoveAllUsageInfoError2 = ERROR_DRM_VENDOR_MIN + 102,
|
||||||
kReleaseKeyError = ERROR_DRM_VENDOR_MIN + 103,
|
kReleaseKeyError = ERROR_DRM_VENDOR_MIN + 103,
|
||||||
kReleaseKeyRequestError = ERROR_DRM_VENDOR_MIN + 104,
|
kReleaseKeyRequestError = ERROR_DRM_VENDOR_MIN + 104,
|
||||||
kReleaseLicenseError1 = ERROR_DRM_VENDOR_MIN + 105,
|
kReleaseLicenseError1 = ERROR_DRM_VENDOR_MIN + 105,
|
||||||
@@ -231,8 +231,8 @@ enum {
|
|||||||
kUsageStoreLicenseFailed = ERROR_DRM_VENDOR_MIN + 241,
|
kUsageStoreLicenseFailed = ERROR_DRM_VENDOR_MIN + 241,
|
||||||
kUsageStoreUsageInfoFailed = ERROR_DRM_VENDOR_MIN + 242,
|
kUsageStoreUsageInfoFailed = ERROR_DRM_VENDOR_MIN + 242,
|
||||||
kUsageInvalidLoadEntry = ERROR_DRM_VENDOR_MIN + 243,
|
kUsageInvalidLoadEntry = ERROR_DRM_VENDOR_MIN + 243,
|
||||||
kReleaseAllUsageInfoError4 = ERROR_DRM_VENDOR_MIN + 244,
|
kRemoveAllUsageInfoError4 = ERROR_DRM_VENDOR_MIN + 244,
|
||||||
kReleaseAllUsageInfoError5 = ERROR_DRM_VENDOR_MIN + 245,
|
kRemoveAllUsageInfoError5 = ERROR_DRM_VENDOR_MIN + 245,
|
||||||
kReleaseUsageInfoFailed = ERROR_DRM_VENDOR_MIN + 246,
|
kReleaseUsageInfoFailed = ERROR_DRM_VENDOR_MIN + 246,
|
||||||
kIncorrectUsageSupportType1 = ERROR_DRM_VENDOR_MIN + 247,
|
kIncorrectUsageSupportType1 = ERROR_DRM_VENDOR_MIN + 247,
|
||||||
kIncorrectUsageSupportType2 = ERROR_DRM_VENDOR_MIN + 248,
|
kIncorrectUsageSupportType2 = ERROR_DRM_VENDOR_MIN + 248,
|
||||||
@@ -254,17 +254,20 @@ enum {
|
|||||||
kUsageStoreEntryRetrieveLicenseFailed = ERROR_DRM_VENDOR_MIN + 264,
|
kUsageStoreEntryRetrieveLicenseFailed = ERROR_DRM_VENDOR_MIN + 264,
|
||||||
kUsageStoreEntryRetrieveUsageInfoFailed = ERROR_DRM_VENDOR_MIN + 265,
|
kUsageStoreEntryRetrieveUsageInfoFailed = ERROR_DRM_VENDOR_MIN + 265,
|
||||||
kUsageStoreEntryRetrieveInvalidStorageType = ERROR_DRM_VENDOR_MIN + 266,
|
kUsageStoreEntryRetrieveInvalidStorageType = ERROR_DRM_VENDOR_MIN + 266,
|
||||||
kReleaseAllUsageInfoError6 = ERROR_DRM_VENDOR_MIN + 267,
|
kRemoveAllUsageInfoError6 = ERROR_DRM_VENDOR_MIN + 267,
|
||||||
kReleaseAllUsageInfoError7 = ERROR_DRM_VENDOR_MIN + 268,
|
kRemoveAllUsageInfoError7 = ERROR_DRM_VENDOR_MIN + 268,
|
||||||
kLicenseRequestInvalidSublicense = ERROR_DRM_VENDOR_MIN + 269,
|
kLicenseRequestInvalidSublicense = ERROR_DRM_VENDOR_MIN + 269,
|
||||||
kCertProvisioningEmptyServiceCertificate = ERROR_DRM_VENDOR_MIN + 270,
|
kCertProvisioningEmptyServiceCertificate = ERROR_DRM_VENDOR_MIN + 270,
|
||||||
kLoadSystemIdError = ERROR_DRM_VENDOR_MIN + 271,
|
kLoadSystemIdError = ERROR_DRM_VENDOR_MIN + 271,
|
||||||
kInsufficientCryptoResources4 = ERROR_DRM_VENDOR_MIN + 272,
|
kInsufficientCryptoResources4 = ERROR_DRM_VENDOR_MIN + 272,
|
||||||
kInsufficientCryptoResources5 = ERROR_DRM_VENDOR_MIN + 273,
|
kInsufficientCryptoResources5 = ERROR_DRM_VENDOR_MIN + 273,
|
||||||
|
kRemoveUsageInfoError1 = ERROR_DRM_VENDOR_MIN + 274,
|
||||||
|
kRemoveUsageInfoError2 = ERROR_DRM_VENDOR_MIN + 275,
|
||||||
|
kRemoveUsageInfoError3 = ERROR_DRM_VENDOR_MIN + 276,
|
||||||
|
|
||||||
// This should always follow the last error code.
|
// This should always follow the last error code.
|
||||||
// The offset value should be updated each time a new error code is added.
|
// The offset value should be updated each time a new error code is added.
|
||||||
kErrorWVDrmMaxErrorUsed = ERROR_DRM_VENDOR_MIN + 273,
|
kErrorWVDrmMaxErrorUsed = ERROR_DRM_VENDOR_MIN + 276,
|
||||||
|
|
||||||
// Used by crypto test mode
|
// Used by crypto test mode
|
||||||
kErrorTestMode = ERROR_DRM_VENDOR_MAX,
|
kErrorTestMode = ERROR_DRM_VENDOR_MAX,
|
||||||
|
|||||||
@@ -189,10 +189,10 @@ static android::status_t mapCdmResponseType(wvcdm::CdmResponseType res) {
|
|||||||
return kNoContentKey;
|
return kNoContentKey;
|
||||||
case wvcdm::REFRESH_KEYS_ERROR:
|
case wvcdm::REFRESH_KEYS_ERROR:
|
||||||
return kRefreshKeysError;
|
return kRefreshKeysError;
|
||||||
case wvcdm::RELEASE_ALL_USAGE_INFO_ERROR_1:
|
case wvcdm::REMOVE_ALL_USAGE_INFO_ERROR_1:
|
||||||
return kReleaseAllUsageInfoError1;
|
return kRemoveAllUsageInfoError1;
|
||||||
case wvcdm::RELEASE_ALL_USAGE_INFO_ERROR_2:
|
case wvcdm::REMOVE_ALL_USAGE_INFO_ERROR_2:
|
||||||
return kReleaseAllUsageInfoError2;
|
return kRemoveAllUsageInfoError2;
|
||||||
case wvcdm::RELEASE_KEY_ERROR:
|
case wvcdm::RELEASE_KEY_ERROR:
|
||||||
return kReleaseKeyError;
|
return kReleaseKeyError;
|
||||||
case wvcdm::RELEASE_KEY_REQUEST_ERROR:
|
case wvcdm::RELEASE_KEY_REQUEST_ERROR:
|
||||||
@@ -447,10 +447,10 @@ static android::status_t mapCdmResponseType(wvcdm::CdmResponseType res) {
|
|||||||
return kIncorrectUsageSupportType1;
|
return kIncorrectUsageSupportType1;
|
||||||
case wvcdm::INCORRECT_USAGE_SUPPORT_TYPE_2:
|
case wvcdm::INCORRECT_USAGE_SUPPORT_TYPE_2:
|
||||||
return kIncorrectUsageSupportType2;
|
return kIncorrectUsageSupportType2;
|
||||||
case wvcdm::RELEASE_ALL_USAGE_INFO_ERROR_4:
|
case wvcdm::REMOVE_ALL_USAGE_INFO_ERROR_4:
|
||||||
return kReleaseAllUsageInfoError4;
|
return kRemoveAllUsageInfoError4;
|
||||||
case wvcdm::RELEASE_ALL_USAGE_INFO_ERROR_5:
|
case wvcdm::REMOVE_ALL_USAGE_INFO_ERROR_5:
|
||||||
return kReleaseAllUsageInfoError5;
|
return kRemoveAllUsageInfoError5;
|
||||||
case wvcdm::NO_USAGE_ENTRIES:
|
case wvcdm::NO_USAGE_ENTRIES:
|
||||||
return kNoUsageEntries;
|
return kNoUsageEntries;
|
||||||
case wvcdm::LIST_LICENSE_ERROR_1:
|
case wvcdm::LIST_LICENSE_ERROR_1:
|
||||||
@@ -489,10 +489,10 @@ static android::status_t mapCdmResponseType(wvcdm::CdmResponseType res) {
|
|||||||
return kUsageStoreEntryRetrieveUsageInfoFailed;
|
return kUsageStoreEntryRetrieveUsageInfoFailed;
|
||||||
case wvcdm::USAGE_STORE_ENTRY_RETRIEVE_INVALID_STORAGE_TYPE:
|
case wvcdm::USAGE_STORE_ENTRY_RETRIEVE_INVALID_STORAGE_TYPE:
|
||||||
return kUsageStoreEntryRetrieveInvalidStorageType;
|
return kUsageStoreEntryRetrieveInvalidStorageType;
|
||||||
case wvcdm::RELEASE_ALL_USAGE_INFO_ERROR_6:
|
case wvcdm::REMOVE_ALL_USAGE_INFO_ERROR_6:
|
||||||
return kReleaseAllUsageInfoError6;
|
return kRemoveAllUsageInfoError6;
|
||||||
case wvcdm::RELEASE_ALL_USAGE_INFO_ERROR_7:
|
case wvcdm::REMOVE_ALL_USAGE_INFO_ERROR_7:
|
||||||
return kReleaseAllUsageInfoError7;
|
return kRemoveAllUsageInfoError7;
|
||||||
case wvcdm::LICENSE_REQUEST_INVALID_SUBLICENSE:
|
case wvcdm::LICENSE_REQUEST_INVALID_SUBLICENSE:
|
||||||
return kLicenseRequestInvalidSublicense;
|
return kLicenseRequestInvalidSublicense;
|
||||||
case wvcdm::CERT_PROVISIONING_EMPTY_SERVICE_CERTIFICATE:
|
case wvcdm::CERT_PROVISIONING_EMPTY_SERVICE_CERTIFICATE:
|
||||||
@@ -503,6 +503,12 @@ static android::status_t mapCdmResponseType(wvcdm::CdmResponseType res) {
|
|||||||
return kInsufficientCryptoResources4;
|
return kInsufficientCryptoResources4;
|
||||||
case wvcdm::INSUFFICIENT_CRYPTO_RESOURCES_5:
|
case wvcdm::INSUFFICIENT_CRYPTO_RESOURCES_5:
|
||||||
return kInsufficientCryptoResources5;
|
return kInsufficientCryptoResources5;
|
||||||
|
case wvcdm::REMOVE_USAGE_INFO_ERROR_1:
|
||||||
|
return kRemoveUsageInfoError1;
|
||||||
|
case wvcdm::REMOVE_USAGE_INFO_ERROR_2:
|
||||||
|
return kRemoveUsageInfoError2;
|
||||||
|
case wvcdm::REMOVE_USAGE_INFO_ERROR_3:
|
||||||
|
return kRemoveUsageInfoError3;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Return here instead of as a default case so that the compiler will warn
|
// Return here instead of as a default case so that the compiler will warn
|
||||||
|
|||||||
@@ -145,8 +145,8 @@ static Status mapCdmResponseType(wvcdm::CdmResponseType res) {
|
|||||||
case wvcdm::LOAD_KEY_ERROR:
|
case wvcdm::LOAD_KEY_ERROR:
|
||||||
case wvcdm::NO_CONTENT_KEY:
|
case wvcdm::NO_CONTENT_KEY:
|
||||||
case wvcdm::REFRESH_KEYS_ERROR:
|
case wvcdm::REFRESH_KEYS_ERROR:
|
||||||
case wvcdm::RELEASE_ALL_USAGE_INFO_ERROR_1:
|
case wvcdm::REMOVE_ALL_USAGE_INFO_ERROR_1:
|
||||||
case wvcdm::RELEASE_ALL_USAGE_INFO_ERROR_2:
|
case wvcdm::REMOVE_ALL_USAGE_INFO_ERROR_2:
|
||||||
case wvcdm::RELEASE_KEY_ERROR:
|
case wvcdm::RELEASE_KEY_ERROR:
|
||||||
case wvcdm::RELEASE_KEY_REQUEST_ERROR:
|
case wvcdm::RELEASE_KEY_REQUEST_ERROR:
|
||||||
case wvcdm::RELEASE_LICENSE_ERROR_1:
|
case wvcdm::RELEASE_LICENSE_ERROR_1:
|
||||||
@@ -264,10 +264,10 @@ static Status mapCdmResponseType(wvcdm::CdmResponseType res) {
|
|||||||
case wvcdm::USAGE_STORE_LICENSE_FAILED:
|
case wvcdm::USAGE_STORE_LICENSE_FAILED:
|
||||||
case wvcdm::USAGE_STORE_USAGE_INFO_FAILED:
|
case wvcdm::USAGE_STORE_USAGE_INFO_FAILED:
|
||||||
case wvcdm::USAGE_INVALID_LOAD_ENTRY:
|
case wvcdm::USAGE_INVALID_LOAD_ENTRY:
|
||||||
case wvcdm::RELEASE_ALL_USAGE_INFO_ERROR_4:
|
case wvcdm::REMOVE_ALL_USAGE_INFO_ERROR_4:
|
||||||
case wvcdm::RELEASE_ALL_USAGE_INFO_ERROR_5:
|
case wvcdm::REMOVE_ALL_USAGE_INFO_ERROR_5:
|
||||||
case wvcdm::RELEASE_ALL_USAGE_INFO_ERROR_6:
|
case wvcdm::REMOVE_ALL_USAGE_INFO_ERROR_6:
|
||||||
case wvcdm::RELEASE_ALL_USAGE_INFO_ERROR_7:
|
case wvcdm::REMOVE_ALL_USAGE_INFO_ERROR_7:
|
||||||
case wvcdm::INCORRECT_USAGE_SUPPORT_TYPE_1:
|
case wvcdm::INCORRECT_USAGE_SUPPORT_TYPE_1:
|
||||||
case wvcdm::INCORRECT_USAGE_SUPPORT_TYPE_2:
|
case wvcdm::INCORRECT_USAGE_SUPPORT_TYPE_2:
|
||||||
case wvcdm::NO_USAGE_ENTRIES:
|
case wvcdm::NO_USAGE_ENTRIES:
|
||||||
@@ -288,6 +288,9 @@ static Status mapCdmResponseType(wvcdm::CdmResponseType res) {
|
|||||||
case wvcdm::PARSE_RESPONSE_ERROR_3:
|
case wvcdm::PARSE_RESPONSE_ERROR_3:
|
||||||
case wvcdm::PARSE_RESPONSE_ERROR_4:
|
case wvcdm::PARSE_RESPONSE_ERROR_4:
|
||||||
case wvcdm::LOAD_SYSTEM_ID_ERROR:
|
case wvcdm::LOAD_SYSTEM_ID_ERROR:
|
||||||
|
case wvcdm::REMOVE_USAGE_INFO_ERROR_1:
|
||||||
|
case wvcdm::REMOVE_USAGE_INFO_ERROR_2:
|
||||||
|
case wvcdm::REMOVE_USAGE_INFO_ERROR_3:
|
||||||
ALOGW("Returns UNKNOWN error for legacy status: %d", res);
|
ALOGW("Returns UNKNOWN error for legacy status: %d", res);
|
||||||
return Status::ERROR_DRM_UNKNOWN;
|
return Status::ERROR_DRM_UNKNOWN;
|
||||||
|
|
||||||
|
|||||||
@@ -457,8 +457,8 @@ status_t WVDrmPlugin::getSecureStops(List<Vector<uint8_t> >& secureStops) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
status_t WVDrmPlugin::releaseAllSecureStops() {
|
status_t WVDrmPlugin::releaseAllSecureStops() {
|
||||||
CdmResponseType res = mCDM->ReleaseAllUsageInfo(mPropertySet.app_id(),
|
CdmResponseType res = mCDM->RemoveAllUsageInfo(mPropertySet.app_id(),
|
||||||
mCdmIdentifier);
|
mCdmIdentifier);
|
||||||
return mapCdmResponseType(res);
|
return mapCdmResponseType(res);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -609,8 +609,8 @@ Return<Status> WVDrmPlugin::releaseAllSecureStops() {
|
|||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
|
|
||||||
CdmResponseType res = mCDM->ReleaseAllUsageInfo(mPropertySet.app_id(),
|
CdmResponseType res = mCDM->RemoveAllUsageInfo(mPropertySet.app_id(),
|
||||||
identifier);
|
identifier);
|
||||||
return mapCdmResponseType(res);
|
return mapCdmResponseType(res);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -190,8 +190,8 @@ class MockCDM : public WvContentDecryptionModule {
|
|||||||
const CdmIdentifier&,
|
const CdmIdentifier&,
|
||||||
CdmUsageInfo*));
|
CdmUsageInfo*));
|
||||||
|
|
||||||
MOCK_METHOD2(ReleaseAllUsageInfo, CdmResponseType(const std::string&,
|
MOCK_METHOD2(RemoveAllUsageInfo, CdmResponseType(const std::string&,
|
||||||
const CdmIdentifier&));
|
const CdmIdentifier&));
|
||||||
|
|
||||||
MOCK_METHOD2(ReleaseUsageInfo,
|
MOCK_METHOD2(ReleaseUsageInfo,
|
||||||
CdmResponseType(const CdmUsageInfoReleaseMessage&, const CdmIdentifier&));
|
CdmResponseType(const CdmUsageInfoReleaseMessage&, const CdmIdentifier&));
|
||||||
@@ -1026,7 +1026,7 @@ TEST_F(WVDrmPluginTest, ReleasesAllSecureStops) {
|
|||||||
StrictMock<MockCrypto> crypto;
|
StrictMock<MockCrypto> crypto;
|
||||||
std::string appPackageName;
|
std::string appPackageName;
|
||||||
|
|
||||||
EXPECT_CALL(*cdm, ReleaseAllUsageInfo(StrEq(""), _))
|
EXPECT_CALL(*cdm, RemoveAllUsageInfo(StrEq(""), _))
|
||||||
.Times(1);
|
.Times(1);
|
||||||
|
|
||||||
WVDrmPlugin plugin(cdm.get(), appPackageName, &crypto, false);
|
WVDrmPlugin plugin(cdm.get(), appPackageName, &crypto, false);
|
||||||
|
|||||||
@@ -100,8 +100,8 @@ class MockCDM : public WvContentDecryptionModule {
|
|||||||
const CdmIdentifier&,
|
const CdmIdentifier&,
|
||||||
CdmUsageInfo*));
|
CdmUsageInfo*));
|
||||||
|
|
||||||
MOCK_METHOD2(ReleaseAllUsageInfo, CdmResponseType(const std::string&,
|
MOCK_METHOD2(RemoveAllUsageInfo, CdmResponseType(const std::string&,
|
||||||
const CdmIdentifier&));
|
const CdmIdentifier&));
|
||||||
|
|
||||||
MOCK_METHOD2(ReleaseUsageInfo,
|
MOCK_METHOD2(ReleaseUsageInfo,
|
||||||
CdmResponseType(const CdmUsageInfoReleaseMessage&, const CdmIdentifier&));
|
CdmResponseType(const CdmUsageInfoReleaseMessage&, const CdmIdentifier&));
|
||||||
@@ -800,7 +800,7 @@ TEST_F(WVDrmPluginTest, ReleasesAllSecureStops) {
|
|||||||
status_t res = plugin.setPropertyString(String8("appId"), String8(""));
|
status_t res = plugin.setPropertyString(String8("appId"), String8(""));
|
||||||
ASSERT_EQ(OK, res);
|
ASSERT_EQ(OK, res);
|
||||||
|
|
||||||
EXPECT_CALL(*cdm, ReleaseAllUsageInfo(StrEq(""), _))
|
EXPECT_CALL(*cdm, RemoveAllUsageInfo(StrEq(""), _))
|
||||||
.Times(1);
|
.Times(1);
|
||||||
|
|
||||||
res = plugin.releaseAllSecureStops();
|
res = plugin.releaseAllSecureStops();
|
||||||
|
|||||||
Reference in New Issue
Block a user