Corrections to license duration reporting
[ Merge of http://go/wvgerrit/34900 ] Querying information about licenses with uncommon duration values did not, under all conditions, return expected values. This corrects for licenses where * playback and license durations were set to unlimited * rental and license durations were set to unlimited Bug: 65669869 Test: 9 new policy_engine_unittests Test: WV unit/integration tests Test: GTSMediaTestCases Test: Playback using netflix and play movies Change-Id: I6e48f82f1f194fb7e04491d33054dfe74d9465eb
This commit is contained in:
@@ -403,6 +403,8 @@ int64_t PolicyEngine::GetLicenseOrRentalDurationRemaining(
|
||||
if (license_expiry_time == NEVER_EXPIRES) return LLONG_MAX;
|
||||
if (license_expiry_time < current_time) return 0;
|
||||
const int64_t policy_license_duration = policy_.license_duration_seconds();
|
||||
if (policy_license_duration == NEVER_EXPIRES)
|
||||
return license_expiry_time - current_time;
|
||||
return std::min(license_expiry_time - current_time, policy_license_duration);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user