Consolidate update usage table calls

[ Merge of http://go/wvgerrit/24147 ]

In OEMCrypto version 13, usage information is updated by calls to
OEMCrypto_UpdateUsageEntry. In previous versions calls were made to
OEMCrypto_UpdateUsageTable instead. Both need to be supported as the
OEMCrypto version may vary by device.

This consolidates calls to OEMCrypto_UpdateUsageTable so that they
can be disabled if OEMCrypto version >= 13. No functional changes other
than disabling by OEMCrypto version were introduced in this section.

Helper routines have been added to device files as well.

Bug: 34327459

Test: WV unit/integration tests
Change-Id: I223b0a947c21b8b7ba3c8f345b0206747eb50984
This commit is contained in:
Rahul Frias
2018-01-04 10:59:05 -08:00
parent 17ccdcf351
commit e34f83cdce
3 changed files with 26 additions and 9 deletions

View File

@@ -671,6 +671,11 @@ bool DeviceFiles::RetrieveUsageInfo(const std::string& usage_info_file_name,
return false;
}
if (usage_data == NULL) {
LOGW("DeviceFiles::RetrieveUsageInfo: usage_data not provided");
return false;
}
if (!FileExists(usage_info_file_name) ||
GetFileSize(usage_info_file_name) == 0) {
usage_data->resize(0);
@@ -706,6 +711,11 @@ bool DeviceFiles::RetrieveUsageInfo(const std::string& usage_info_file_name,
return false;
}
if (usage_data == NULL) {
LOGW("DeviceFiles::RetrieveUsageInfo: usage_data not provided");
return false;
}
video_widevine_client::sdk::File file;
if (!RetrieveHashedFile(usage_info_file_name, &file)) {
return false;