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:
Rahul Frias
2018-03-08 14:27:59 -08:00
parent 6a4abc15fe
commit 1d9a16c3b9
16 changed files with 115 additions and 84 deletions

View File

@@ -212,13 +212,13 @@ class CdmEngine {
const CdmSecureStopId& ssid,
CdmUsageInfo* usage_info);
// Release all usage records for the current origin.
virtual CdmResponseType ReleaseAllUsageInfo(const std::string& app_id,
CdmSecurityLevel security_level);
// Remove all usage records for the current origin.
virtual CdmResponseType RemoveAllUsageInfo(const std::string& app_id,
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.
virtual CdmResponseType ReleaseAllUsageInfo(const std::string& app_id);
virtual CdmResponseType RemoveAllUsageInfo(const std::string& app_id);
virtual CdmResponseType ReleaseUsageInfo(
const CdmUsageInfoReleaseMessage& message);

View File

@@ -140,8 +140,8 @@ enum CdmResponseType {
LOAD_KEY_ERROR = 99,
NO_CONTENT_KEY = 100,
REFRESH_KEYS_ERROR = 101,
RELEASE_ALL_USAGE_INFO_ERROR_1 = 102,
RELEASE_ALL_USAGE_INFO_ERROR_2 = 103,
REMOVE_ALL_USAGE_INFO_ERROR_1 = 102,
REMOVE_ALL_USAGE_INFO_ERROR_2 = 103,
RELEASE_KEY_ERROR = 104,
RELEASE_KEY_REQUEST_ERROR = 105,
RELEASE_LICENSE_ERROR_1 = 106,
@@ -289,8 +289,8 @@ enum CdmResponseType {
USAGE_STORE_LICENSE_FAILED = 247,
USAGE_STORE_USAGE_INFO_FAILED = 248,
USAGE_INVALID_LOAD_ENTRY = 249,
RELEASE_ALL_USAGE_INFO_ERROR_4 = 250,
RELEASE_ALL_USAGE_INFO_ERROR_5 = 251,
REMOVE_ALL_USAGE_INFO_ERROR_4 = 250,
REMOVE_ALL_USAGE_INFO_ERROR_5 = 251,
RELEASE_USAGE_INFO_FAILED = 252,
INCORRECT_USAGE_SUPPORT_TYPE_1 = 253,
INCORRECT_USAGE_SUPPORT_TYPE_2 = 254,
@@ -314,13 +314,16 @@ enum CdmResponseType {
USAGE_STORE_ENTRY_RETRIEVE_LICENSE_FAILED = 272,
USAGE_STORE_ENTRY_RETRIEVE_USAGE_INFO_FAILED = 273,
USAGE_STORE_ENTRY_RETRIEVE_INVALID_STORAGE_TYPE = 274,
RELEASE_ALL_USAGE_INFO_ERROR_6 = 275,
RELEASE_ALL_USAGE_INFO_ERROR_7 = 276,
REMOVE_ALL_USAGE_INFO_ERROR_6 = 275,
REMOVE_ALL_USAGE_INFO_ERROR_7 = 276,
LICENSE_REQUEST_INVALID_SUBLICENSE = 277,
CERT_PROVISIONING_EMPTY_SERVICE_CERTIFICATE = 278,
LOAD_SYSTEM_ID_ERROR = 279,
INSUFFICIENT_CRYPTO_RESOURCES_4 = 280,
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 {

View File

@@ -1156,17 +1156,17 @@ CdmResponseType CdmEngine::GetUsageInfo(const std::string& app_id,
return status;
}
CdmResponseType CdmEngine::ReleaseAllUsageInfo(
CdmResponseType CdmEngine::RemoveAllUsageInfo(
const std::string& app_id, CdmSecurityLevel security_level) {
DeviceFiles handle(file_system_);
if (!handle.Init(security_level)) {
LOGE("CdmEngine::ReleaseAllUsageInfo: unable to initialize device files");
return RELEASE_ALL_USAGE_INFO_ERROR_6;
LOGE("CdmEngine::RemoveAllUsageInfo: unable to initialize device files");
return REMOVE_ALL_USAGE_INFO_ERROR_6;
}
std::vector<std::string> provider_session_tokens;
if (!handle.DeleteAllUsageInfoForApp(app_id, &provider_session_tokens)) {
LOGE("CdmEngine::ReleaseAllUsageInfo: failed to delete usage records");
return RELEASE_ALL_USAGE_INFO_ERROR_7;
LOGE("CdmEngine::RemoveAllUsageInfo: failed to delete usage records");
return REMOVE_ALL_USAGE_INFO_ERROR_7;
}
if (provider_session_tokens.size() == 0UL) {
@@ -1183,12 +1183,12 @@ CdmResponseType CdmEngine::ReleaseAllUsageInfo(
DeleteMultipleUsageInformation(provider_session_tokens);
}
if (status != NO_ERROR) {
LOGE("CdmEngine::ReleaseAllUsageInfo: CryptoSession failure");
LOGE("CdmEngine::RemoveAllUsageInfo: CryptoSession failure");
}
return status;
}
CdmResponseType CdmEngine::ReleaseAllUsageInfo(const std::string& app_id) {
CdmResponseType CdmEngine::RemoveAllUsageInfo(const std::string& app_id) {
if (NULL == usage_property_set_.get()) {
usage_property_set_.reset(new UsagePropertySet());
}
@@ -1216,7 +1216,7 @@ CdmResponseType CdmEngine::ReleaseAllUsageInfo(const std::string& app_id) {
if (!handle.RetrieveUsageInfo(
DeviceFiles::GetUsageInfoFileName(app_id),
&usage_data)) {
status = RELEASE_ALL_USAGE_INFO_ERROR_4;
status = REMOVE_ALL_USAGE_INFO_ERROR_4;
break;
}
@@ -1230,7 +1230,7 @@ CdmResponseType CdmEngine::ReleaseAllUsageInfo(const std::string& app_id) {
if (!handle.DeleteUsageInfo(
DeviceFiles::GetUsageInfoFileName(app_id),
usage_data[0].provider_session_token)) {
status = RELEASE_ALL_USAGE_INFO_ERROR_6;
status = REMOVE_ALL_USAGE_INFO_ERROR_6;
break;
}
} while (status == NO_ERROR && !usage_data.empty());
@@ -1239,7 +1239,7 @@ CdmResponseType CdmEngine::ReleaseAllUsageInfo(const std::string& app_id) {
if (!handle.DeleteAllUsageInfoForApp(
DeviceFiles::GetUsageInfoFileName(app_id),
&provider_session_tokens)) {
status = RELEASE_ALL_USAGE_INFO_ERROR_5;
status = REMOVE_ALL_USAGE_INFO_ERROR_5;
}
break;
}
@@ -1248,9 +1248,9 @@ CdmResponseType CdmEngine::ReleaseAllUsageInfo(const std::string& app_id) {
if (!handle.DeleteAllUsageInfoForApp(
DeviceFiles::GetUsageInfoFileName(app_id),
&provider_session_tokens)) {
LOGE("CdmEngine::ReleaseAllUsageInfo: failed to delete %d secure"
LOGE("CdmEngine::RemoveAllUsageInfo: failed to delete %d secure"
"stops", j);
status = RELEASE_ALL_USAGE_INFO_ERROR_1;
status = REMOVE_ALL_USAGE_INFO_ERROR_1;
} else {
CdmResponseType status2 = usage_session_->
DeleteMultipleUsageInformation(provider_session_tokens);
@@ -1263,9 +1263,9 @@ CdmResponseType CdmEngine::ReleaseAllUsageInfo(const std::string& app_id) {
break;
}
} else {
LOGE("CdmEngine::ReleaseAllUsageInfo: failed to initialize L%d device"
LOGE("CdmEngine::RemoveAllUsageInfo: failed to initialize L%d device"
"files", j);
status = RELEASE_ALL_USAGE_INFO_ERROR_2;
status = REMOVE_ALL_USAGE_INFO_ERROR_2;
}
}
usage_session_.reset(NULL);

View File

@@ -221,23 +221,23 @@ void PrintTo(const enum CdmResponseType& value, ::std::ostream* os) {
break;
case REFRESH_KEYS_ERROR: *os << "REFRESH_KEYS_ERROR";
break;
case RELEASE_ALL_USAGE_INFO_ERROR_1:
*os << "RELEASE_ALL_USAGE_INFO_ERROR_1";
case REMOVE_ALL_USAGE_INFO_ERROR_1:
*os << "REMOVE_ALL_USAGE_INFO_ERROR_1";
break;
case RELEASE_ALL_USAGE_INFO_ERROR_2:
*os << "RELEASE_ALL_USAGE_INFO_ERROR_2";
case REMOVE_ALL_USAGE_INFO_ERROR_2:
*os << "REMOVE_ALL_USAGE_INFO_ERROR_2";
break;
case RELEASE_ALL_USAGE_INFO_ERROR_4:
*os << "RELEASE_ALL_USAGE_INFO_ERROR_4";
case REMOVE_ALL_USAGE_INFO_ERROR_4:
*os << "REMOVE_ALL_USAGE_INFO_ERROR_4";
break;
case RELEASE_ALL_USAGE_INFO_ERROR_5:
*os << "RELEASE_ALL_USAGE_INFO_ERROR_5";
case REMOVE_ALL_USAGE_INFO_ERROR_5:
*os << "REMOVE_ALL_USAGE_INFO_ERROR_5";
break;
case RELEASE_ALL_USAGE_INFO_ERROR_6:
*os << "RELEASE_ALL_USAGE_INFO_ERROR_6";
case REMOVE_ALL_USAGE_INFO_ERROR_6:
*os << "REMOVE_ALL_USAGE_INFO_ERROR_6";
break;
case RELEASE_ALL_USAGE_INFO_ERROR_7:
*os << "RELEASE_ALL_USAGE_INFO_ERROR_7";
case REMOVE_ALL_USAGE_INFO_ERROR_7:
*os << "REMOVE_ALL_USAGE_INFO_ERROR_7";
break;
case RELEASE_KEY_ERROR: *os << "RELEASE_KEY_ERROR";
break;
@@ -578,6 +578,12 @@ void PrintTo(const enum CdmResponseType& value, ::std::ostream* os) {
case INSUFFICIENT_CRYPTO_RESOURCES_5:
*os << "INSUFFICIENT_CRYPTO_RESOURCES_5";
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:
*os << "Unknown CdmResponseType";
break;

View File

@@ -105,8 +105,8 @@ class WvContentDecryptionModule : public android::RefBase, public TimerHandler {
const CdmSecureStopId& ssid,
const CdmIdentifier& identifier,
CdmUsageInfo* usage_info);
virtual CdmResponseType ReleaseAllUsageInfo(const std::string& app_id,
const CdmIdentifier& identifier);
virtual CdmResponseType RemoveAllUsageInfo(const std::string& app_id,
const CdmIdentifier& identifier);
virtual CdmResponseType ReleaseUsageInfo(
const CdmUsageInfoReleaseMessage& message,
const CdmIdentifier& identifier);

View File

@@ -279,8 +279,10 @@ class EngineMetrics {
CounterMetric<CdmResponseType> cdm_engine_open_key_set_session_;
CounterMetric<CdmResponseType> cdm_engine_open_session_;
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_get_secure_stop_ids_;
CounterMetric<CdmResponseType> cdm_engine_remove_keys_;
EventMetric<CdmResponseType> cdm_engine_restore_key_;
CounterMetric<CdmResponseType, CdmSecurityLevel> cdm_engine_unprovision_;

View File

@@ -420,12 +420,18 @@ EngineMetrics::EngineMetrics() :
cdm_engine_query_key_status_(
"/drm/widevine/cdm_engine/query_key_status/time",
"error"),
cdm_engine_release_all_usage_info_(
"/drm/widevine/cdm_engine/release_all_usage_info",
cdm_engine_remove_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"),
cdm_engine_release_usage_info_(
"/drm/widevine/cdm_engine/release_usage_info",
"error"),
cdm_engine_get_secure_stop_ids_(
"/drm/widevine/cdm_engine/get_secure_stop_ids",
"error"),
cdm_engine_remove_keys_(
"/drm/widevine/cdm_engine/remove_keys",
"error"),
@@ -524,8 +530,10 @@ void EngineMetrics::SerializeEngineMetrics(MetricsGroup* metric_group) {
cdm_engine_open_key_set_session_.Serialize(&serializer);
cdm_engine_open_session_.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_get_secure_stop_ids_.Serialize(&serializer);
cdm_engine_remove_keys_.Serialize(&serializer);
cdm_engine_restore_key_.Serialize(&serializer);
cdm_engine_unprovision_.Serialize(&serializer);

View File

@@ -297,11 +297,11 @@ CdmResponseType WvContentDecryptionModule::GetUsageInfo(
return sts;
}
CdmResponseType WvContentDecryptionModule::ReleaseAllUsageInfo(
CdmResponseType WvContentDecryptionModule::RemoveAllUsageInfo(
const std::string& app_id, const CdmIdentifier& identifier) {
CdmEngine* cdm_engine = EnsureCdmForIdentifier(identifier);
CdmResponseType sts = cdm_engine->ReleaseAllUsageInfo(app_id);
cdm_engine->GetMetrics()->cdm_engine_release_all_usage_info_.Increment(sts);
CdmResponseType sts = cdm_engine->RemoveAllUsageInfo(app_id);
cdm_engine->GetMetrics()->cdm_engine_remove_all_usage_info_.Increment(sts);
return sts;
}

View File

@@ -2956,7 +2956,7 @@ INSTANTIATE_TEST_CASE_P(Cdm, WvCdmUsageInfoTest,
&usage_info_sub_sample_info[6],
&usage_info_sub_sample_info[7]));
TEST_F(WvCdmRequestLicenseTest, UsageReleaseAllTest) {
TEST_F(WvCdmRequestLicenseTest, UsageRemoveAllTest) {
Unprovision();
std::string app_id_empty = "";
@@ -3025,7 +3025,7 @@ TEST_F(WvCdmRequestLicenseTest, UsageReleaseAllTest) {
EXPECT_EQ(
NO_ERROR,
decryptor_.ReleaseAllUsageInfo(app_id_not_empty, kDefaultCdmIdentifier));
decryptor_.RemoveAllUsageInfo(app_id_not_empty, kDefaultCdmIdentifier));
EXPECT_EQ(
NO_ERROR,
@@ -3040,7 +3040,7 @@ TEST_F(WvCdmRequestLicenseTest, UsageReleaseAllTest) {
EXPECT_EQ(
NO_ERROR,
decryptor_.ReleaseAllUsageInfo(app_id_empty, kDefaultCdmIdentifier));
decryptor_.RemoveAllUsageInfo(app_id_empty, kDefaultCdmIdentifier));
EXPECT_EQ(
NO_ERROR,

View File

@@ -99,8 +99,8 @@ enum {
kNoContentKey = ERROR_DRM_VENDOR_MIN + 98,
kProvisioningGetKeyboxError = ERROR_DRM_VENDOR_MIN + 99,
kRefreshKeysError = ERROR_DRM_VENDOR_MIN + 100,
kReleaseAllUsageInfoError1 = ERROR_DRM_VENDOR_MIN + 101,
kReleaseAllUsageInfoError2 = ERROR_DRM_VENDOR_MIN + 102,
kRemoveAllUsageInfoError1 = ERROR_DRM_VENDOR_MIN + 101,
kRemoveAllUsageInfoError2 = ERROR_DRM_VENDOR_MIN + 102,
kReleaseKeyError = ERROR_DRM_VENDOR_MIN + 103,
kReleaseKeyRequestError = ERROR_DRM_VENDOR_MIN + 104,
kReleaseLicenseError1 = ERROR_DRM_VENDOR_MIN + 105,
@@ -231,8 +231,8 @@ enum {
kUsageStoreLicenseFailed = ERROR_DRM_VENDOR_MIN + 241,
kUsageStoreUsageInfoFailed = ERROR_DRM_VENDOR_MIN + 242,
kUsageInvalidLoadEntry = ERROR_DRM_VENDOR_MIN + 243,
kReleaseAllUsageInfoError4 = ERROR_DRM_VENDOR_MIN + 244,
kReleaseAllUsageInfoError5 = ERROR_DRM_VENDOR_MIN + 245,
kRemoveAllUsageInfoError4 = ERROR_DRM_VENDOR_MIN + 244,
kRemoveAllUsageInfoError5 = ERROR_DRM_VENDOR_MIN + 245,
kReleaseUsageInfoFailed = ERROR_DRM_VENDOR_MIN + 246,
kIncorrectUsageSupportType1 = ERROR_DRM_VENDOR_MIN + 247,
kIncorrectUsageSupportType2 = ERROR_DRM_VENDOR_MIN + 248,
@@ -254,17 +254,20 @@ enum {
kUsageStoreEntryRetrieveLicenseFailed = ERROR_DRM_VENDOR_MIN + 264,
kUsageStoreEntryRetrieveUsageInfoFailed = ERROR_DRM_VENDOR_MIN + 265,
kUsageStoreEntryRetrieveInvalidStorageType = ERROR_DRM_VENDOR_MIN + 266,
kReleaseAllUsageInfoError6 = ERROR_DRM_VENDOR_MIN + 267,
kReleaseAllUsageInfoError7 = ERROR_DRM_VENDOR_MIN + 268,
kRemoveAllUsageInfoError6 = ERROR_DRM_VENDOR_MIN + 267,
kRemoveAllUsageInfoError7 = ERROR_DRM_VENDOR_MIN + 268,
kLicenseRequestInvalidSublicense = ERROR_DRM_VENDOR_MIN + 269,
kCertProvisioningEmptyServiceCertificate = ERROR_DRM_VENDOR_MIN + 270,
kLoadSystemIdError = ERROR_DRM_VENDOR_MIN + 271,
kInsufficientCryptoResources4 = ERROR_DRM_VENDOR_MIN + 272,
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.
// 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
kErrorTestMode = ERROR_DRM_VENDOR_MAX,

View File

@@ -189,10 +189,10 @@ static android::status_t mapCdmResponseType(wvcdm::CdmResponseType res) {
return kNoContentKey;
case wvcdm::REFRESH_KEYS_ERROR:
return kRefreshKeysError;
case wvcdm::RELEASE_ALL_USAGE_INFO_ERROR_1:
return kReleaseAllUsageInfoError1;
case wvcdm::RELEASE_ALL_USAGE_INFO_ERROR_2:
return kReleaseAllUsageInfoError2;
case wvcdm::REMOVE_ALL_USAGE_INFO_ERROR_1:
return kRemoveAllUsageInfoError1;
case wvcdm::REMOVE_ALL_USAGE_INFO_ERROR_2:
return kRemoveAllUsageInfoError2;
case wvcdm::RELEASE_KEY_ERROR:
return kReleaseKeyError;
case wvcdm::RELEASE_KEY_REQUEST_ERROR:
@@ -447,10 +447,10 @@ static android::status_t mapCdmResponseType(wvcdm::CdmResponseType res) {
return kIncorrectUsageSupportType1;
case wvcdm::INCORRECT_USAGE_SUPPORT_TYPE_2:
return kIncorrectUsageSupportType2;
case wvcdm::RELEASE_ALL_USAGE_INFO_ERROR_4:
return kReleaseAllUsageInfoError4;
case wvcdm::RELEASE_ALL_USAGE_INFO_ERROR_5:
return kReleaseAllUsageInfoError5;
case wvcdm::REMOVE_ALL_USAGE_INFO_ERROR_4:
return kRemoveAllUsageInfoError4;
case wvcdm::REMOVE_ALL_USAGE_INFO_ERROR_5:
return kRemoveAllUsageInfoError5;
case wvcdm::NO_USAGE_ENTRIES:
return kNoUsageEntries;
case wvcdm::LIST_LICENSE_ERROR_1:
@@ -489,10 +489,10 @@ static android::status_t mapCdmResponseType(wvcdm::CdmResponseType res) {
return kUsageStoreEntryRetrieveUsageInfoFailed;
case wvcdm::USAGE_STORE_ENTRY_RETRIEVE_INVALID_STORAGE_TYPE:
return kUsageStoreEntryRetrieveInvalidStorageType;
case wvcdm::RELEASE_ALL_USAGE_INFO_ERROR_6:
return kReleaseAllUsageInfoError6;
case wvcdm::RELEASE_ALL_USAGE_INFO_ERROR_7:
return kReleaseAllUsageInfoError7;
case wvcdm::REMOVE_ALL_USAGE_INFO_ERROR_6:
return kRemoveAllUsageInfoError6;
case wvcdm::REMOVE_ALL_USAGE_INFO_ERROR_7:
return kRemoveAllUsageInfoError7;
case wvcdm::LICENSE_REQUEST_INVALID_SUBLICENSE:
return kLicenseRequestInvalidSublicense;
case wvcdm::CERT_PROVISIONING_EMPTY_SERVICE_CERTIFICATE:
@@ -503,6 +503,12 @@ static android::status_t mapCdmResponseType(wvcdm::CdmResponseType res) {
return kInsufficientCryptoResources4;
case wvcdm::INSUFFICIENT_CRYPTO_RESOURCES_5:
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

View File

@@ -145,8 +145,8 @@ static Status mapCdmResponseType(wvcdm::CdmResponseType res) {
case wvcdm::LOAD_KEY_ERROR:
case wvcdm::NO_CONTENT_KEY:
case wvcdm::REFRESH_KEYS_ERROR:
case wvcdm::RELEASE_ALL_USAGE_INFO_ERROR_1:
case wvcdm::RELEASE_ALL_USAGE_INFO_ERROR_2:
case wvcdm::REMOVE_ALL_USAGE_INFO_ERROR_1:
case wvcdm::REMOVE_ALL_USAGE_INFO_ERROR_2:
case wvcdm::RELEASE_KEY_ERROR:
case wvcdm::RELEASE_KEY_REQUEST_ERROR:
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_USAGE_INFO_FAILED:
case wvcdm::USAGE_INVALID_LOAD_ENTRY:
case wvcdm::RELEASE_ALL_USAGE_INFO_ERROR_4:
case wvcdm::RELEASE_ALL_USAGE_INFO_ERROR_5:
case wvcdm::RELEASE_ALL_USAGE_INFO_ERROR_6:
case wvcdm::RELEASE_ALL_USAGE_INFO_ERROR_7:
case wvcdm::REMOVE_ALL_USAGE_INFO_ERROR_4:
case wvcdm::REMOVE_ALL_USAGE_INFO_ERROR_5:
case wvcdm::REMOVE_ALL_USAGE_INFO_ERROR_6:
case wvcdm::REMOVE_ALL_USAGE_INFO_ERROR_7:
case wvcdm::INCORRECT_USAGE_SUPPORT_TYPE_1:
case wvcdm::INCORRECT_USAGE_SUPPORT_TYPE_2:
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_4:
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);
return Status::ERROR_DRM_UNKNOWN;

View File

@@ -457,8 +457,8 @@ status_t WVDrmPlugin::getSecureStops(List<Vector<uint8_t> >& secureStops) {
}
status_t WVDrmPlugin::releaseAllSecureStops() {
CdmResponseType res = mCDM->ReleaseAllUsageInfo(mPropertySet.app_id(),
mCdmIdentifier);
CdmResponseType res = mCDM->RemoveAllUsageInfo(mPropertySet.app_id(),
mCdmIdentifier);
return mapCdmResponseType(res);
}

View File

@@ -609,8 +609,8 @@ Return<Status> WVDrmPlugin::releaseAllSecureStops() {
return status;
}
CdmResponseType res = mCDM->ReleaseAllUsageInfo(mPropertySet.app_id(),
identifier);
CdmResponseType res = mCDM->RemoveAllUsageInfo(mPropertySet.app_id(),
identifier);
return mapCdmResponseType(res);
}

View File

@@ -190,8 +190,8 @@ class MockCDM : public WvContentDecryptionModule {
const CdmIdentifier&,
CdmUsageInfo*));
MOCK_METHOD2(ReleaseAllUsageInfo, CdmResponseType(const std::string&,
const CdmIdentifier&));
MOCK_METHOD2(RemoveAllUsageInfo, CdmResponseType(const std::string&,
const CdmIdentifier&));
MOCK_METHOD2(ReleaseUsageInfo,
CdmResponseType(const CdmUsageInfoReleaseMessage&, const CdmIdentifier&));
@@ -1026,7 +1026,7 @@ TEST_F(WVDrmPluginTest, ReleasesAllSecureStops) {
StrictMock<MockCrypto> crypto;
std::string appPackageName;
EXPECT_CALL(*cdm, ReleaseAllUsageInfo(StrEq(""), _))
EXPECT_CALL(*cdm, RemoveAllUsageInfo(StrEq(""), _))
.Times(1);
WVDrmPlugin plugin(cdm.get(), appPackageName, &crypto, false);

View File

@@ -100,8 +100,8 @@ class MockCDM : public WvContentDecryptionModule {
const CdmIdentifier&,
CdmUsageInfo*));
MOCK_METHOD2(ReleaseAllUsageInfo, CdmResponseType(const std::string&,
const CdmIdentifier&));
MOCK_METHOD2(RemoveAllUsageInfo, CdmResponseType(const std::string&,
const CdmIdentifier&));
MOCK_METHOD2(ReleaseUsageInfo,
CdmResponseType(const CdmUsageInfoReleaseMessage&, const CdmIdentifier&));
@@ -800,7 +800,7 @@ TEST_F(WVDrmPluginTest, ReleasesAllSecureStops) {
status_t res = plugin.setPropertyString(String8("appId"), String8(""));
ASSERT_EQ(OK, res);
EXPECT_CALL(*cdm, ReleaseAllUsageInfo(StrEq(""), _))
EXPECT_CALL(*cdm, RemoveAllUsageInfo(StrEq(""), _))
.Times(1);
res = plugin.releaseAllSecureStops();