Add InactiveUnused to Usage Report status

Merge from Widevine repo of http://go/wvgerrit/22963

This change kInactive to kInactiveUsed and adds kInactiveUnused to the
possible values for the status field in the Usage Report.  This CL
updates the header, the unit tests, and haystack and reference code.

b/32714323

Change-Id: If8d8e32ea1e3dc18da34e5fae35f578b027de9c7
This commit is contained in:
Fred Gylys-Colwell
2017-01-20 18:52:02 -08:00
parent b2a3921b37
commit a494eeafdc
8 changed files with 36 additions and 22 deletions

View File

@@ -877,8 +877,12 @@ CdmResponseType CryptoSession::GenerateUsageReport(
ntohll64(pst_report.seconds_since_last_decrypt));
LOGV("OEMCrypto_PST_Report: %s\n", b2a_hex(*usage_report).c_str());
// When usage report state is inactive, we have to deduce whether the
// license was ever used.
if (kInactiveUnused == pst_report.status) {
*usage_duration_status = kUsageDurationPlaybackNotBegun;
return NO_ERROR;
}
// Before OEMCrypto v13, When usage report state is inactive, we have to
// deduce whether the license was ever used.
if (kInactive == pst_report.status &&
(0 > ntohll64(pst_report.seconds_since_first_decrypt) ||
ntohll64(pst_report.seconds_since_license_received) <

View File

@@ -571,7 +571,7 @@ class WvCdmExtendedDurationTest : public WvCdmTestBase {
sizeof(usage_report));
EXPECT_EQ(sizeof(usage_report) + usage_report.pst_length,
existing_license.session_usage_table_entry().size());
EXPECT_EQ(kInactive, usage_report.status);
EXPECT_EQ(kInactiveUsed, usage_report.status);
EXPECT_EQ(id.provider_session_token().size(), usage_report.pst_length);
std::string pst(existing_license.session_usage_table_entry().data() +
sizeof(OEMCrypto_PST_Report),