Add License::Policy::soft_enforce_playback_duration

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

b/34211676

Test: All unittests other than some oemcrypto, request_license_test
passed. Those tests failed with or without this CL.

Change-Id: I20474339aa1777da2db3677c10f186726505ecc8
This commit is contained in:
Rahul Frias
2017-01-13 19:20:30 -08:00
parent b413037733
commit 4ba59828eb
4 changed files with 110 additions and 6 deletions

View File

@@ -119,7 +119,7 @@ class PolicyEngine {
int64_t GetRentalExpiryTime();
// Gets the clock time that the license expires based on whether we have
// started playing. This takes into account GetHardLicenseExpiryTime.
int64_t GetExpiryTime();
int64_t GetExpiryTime(bool ignore_soft_enforce_playback_duration);
int64_t GetLicenseOrRentalDurationRemaining(int64_t current_time);
int64_t GetPlaybackDurationRemaining(int64_t current_time);
@@ -161,6 +161,7 @@ class PolicyEngine {
int64_t last_playback_time_;
int64_t last_expiry_time_;
bool last_expiry_time_set_;
bool was_expired_on_load_;
// This is used as a reference point for policy management. This value
// represents an offset from license_start_time_. This is used to