Fixes for renew on license load

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

* Renew timer offset from when license is loaded verifies that the
  rental duration has not expired and begins decryption.
* Renew timer offset from first decrypt bugfix
* Feature is enabled based on oemcrypto v18 presence
* Renewal logic verifies that |can_renew| is enabled
* Unit tests were added to reflect use cases from duration
  and renewal documentation

Bug: 278751387
Test: policy unittests, CdmUseCase tests, wvts tests
Change-Id: I3070b3f31b316e150c28ebe38d0440ab1eeb89b9
This commit is contained in:
Rahul Frias
2023-05-08 16:41:13 -07:00
parent 13368f4076
commit 669fc9c7af
5 changed files with 2436 additions and 13 deletions

View File

@@ -119,7 +119,7 @@ class PolicyTimers {
// started playing. This takes into account GetHardLicenseExpiryTime.
virtual int64_t GetExpiryTime(int64_t current_time,
bool ignore_soft_enforce_playback_duration);
virtual int64_t GetRentalExpiryTime(int64_t current_time);
virtual int64_t GetRenewalStartTime() { return renewal_start_time_; }
// This is the current policy information for this license. This gets updated
@@ -139,7 +139,6 @@ class PolicyTimers {
private:
// Gets the clock time that the rental duration or playback will expire.
virtual int64_t GetRentalExpiryTime(int64_t current_time);
virtual int64_t GetPlaybackExpiryTime(
int64_t current_time, bool ignore_soft_enforce_playback_duration);
bool HasRentalOrPlaybackDurationExpired(int64_t current_time);