More policy engine/timers refactoring

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

Some more rework of policy engine/policy timers code to support
timer and clock value handling introduced by OEMCrypto v16.

Changes are
* renamed methods to include rental duration since policies for v16 use
  rental and playback duration for all licenses. Previously rental and
  playback durations enforced timing for persistent licenses and license
  duration was used for streaming licenses.
* Moved some common code to the base PolicyTimer class from
  PolicyTimerV15.
* Corrected data member naming (policy_timers -> policy_timers_)
* Updated comments

Bug: 139372190
Test: Android WV unit/integration tests
Change-Id: Id925ddcc14608a8500f30c2c68486d91608a9abe
This commit is contained in:
Rahul Frias
2020-02-13 02:39:50 -08:00
parent 3012ff29bd
commit 68587be8a0
7 changed files with 97 additions and 79 deletions

View File

@@ -105,8 +105,8 @@ class PolicyEngine {
bool IsLicenseForFuture() { return license_state_ == kLicenseStatePending; }
bool HasLicenseOrPlaybackDurationExpired(int64_t current_time);
int64_t GetLicenseOrPlaybackDurationRemaining();
bool HasLicenseOrRentalOrPlaybackDurationExpired(int64_t current_time);
int64_t GetLicenseOrRentalOrPlaybackDurationRemaining();
bool CanRenew() const;
@@ -177,7 +177,7 @@ class PolicyEngine {
uint32_t current_resolution_;
CryptoSession* crypto_session_;
std::unique_ptr<PolicyTimers> policy_timers;
std::unique_ptr<PolicyTimers> policy_timers_;
std::unique_ptr<Clock> clock_;
CORE_DISALLOW_COPY_AND_ASSIGN(PolicyEngine);