Use 0 to represent unexpired license in OnExpirationUpdate
Also fix a missing change for "playback duration should override license duration". Merged from Widevine CDM repo: https://widevine-internal-review.googlesource.com/#/c/14435/ Bug: 21393975 Change-Id: Ibfcf3ae4c13db8944ea285bcc79b6312ea621e1b
This commit is contained in:
@@ -66,13 +66,6 @@ class PolicyEngine {
|
||||
|
||||
virtual const LicenseIdentification& license_id() { return license_id_; }
|
||||
|
||||
bool IsLicenseDurationExpired(int64_t current_time) {
|
||||
return GetLicenseExpiryTime() <= current_time;
|
||||
}
|
||||
bool IsPlaybackDurationExpired(int64_t current_time) {
|
||||
return GetPlaybackExpiryTime() <= current_time;
|
||||
}
|
||||
|
||||
bool GetSecondsSinceStarted(int64_t* seconds_since_started);
|
||||
bool GetSecondsSinceLastPlayed(int64_t* seconds_since_started);
|
||||
|
||||
@@ -85,6 +78,8 @@ class PolicyEngine {
|
||||
bool IsLicenseForFuture() { return license_state_ == kLicenseStatePending; }
|
||||
bool IsPlaybackStarted() { return playback_start_time_ > 0; }
|
||||
|
||||
bool IsLicenseOrPlaybackDurationExpired(int64_t current_time);
|
||||
|
||||
private:
|
||||
friend class PolicyEngineTest;
|
||||
|
||||
@@ -139,6 +134,7 @@ class PolicyEngine {
|
||||
int64_t playback_start_time_;
|
||||
int64_t last_playback_time_;
|
||||
int64_t last_expiry_time_;
|
||||
bool last_expiry_time_set_;
|
||||
|
||||
// This is used as a reference point for policy management. This value
|
||||
// represents an offset from license_start_time_. This is used to
|
||||
|
||||
Reference in New Issue
Block a user