Added debugOtaKeyboxFallbackDuration property. am: 8b12e5acc9 am: 90f7296a4e
Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/16096276 Change-Id: I1e2103a2a3dcfa513be3e6803ebc7b786f846ee2
This commit is contained in:
@@ -360,6 +360,16 @@ class CdmEngine {
|
||||
virtual void SetUserId(uint32_t user_id) { user_id_ = user_id; }
|
||||
virtual uint32_t GetUserId() const { return user_id_; }
|
||||
|
||||
// Changes the rules used for calculating the fallback duration
|
||||
// when OTA keybox provisioning fails.
|
||||
// Default rules use fallback duration measured in days, with exponential
|
||||
// backoff.
|
||||
// Fast rules use fallback durations of a few seconds, without exponential
|
||||
// backoff.
|
||||
// This method has no effect if OTA keybox is not required.
|
||||
virtual void SetDefaultOtaKeyboxFallbackDurationRules();
|
||||
virtual void SetFastOtaKeyboxFallbackDurationRules();
|
||||
|
||||
protected:
|
||||
friend class CdmEngineFactory;
|
||||
|
||||
|
||||
@@ -21,6 +21,7 @@
|
||||
#include "device_files.h"
|
||||
#include "file_store.h"
|
||||
#include "log.h"
|
||||
#include "okp_fallback_policy.h"
|
||||
#include "ota_keybox_provisioner.h"
|
||||
#include "properties.h"
|
||||
#include "string_conversions.h"
|
||||
@@ -2154,4 +2155,26 @@ void CdmEngine::OkpCleanUp() {
|
||||
}
|
||||
okp_provisioner_.reset();
|
||||
}
|
||||
|
||||
void CdmEngine::SetDefaultOtaKeyboxFallbackDurationRules() {
|
||||
OkpCheck();
|
||||
std::unique_lock<std::mutex> lock(okp_mutex_);
|
||||
auto* system_fallback_policy = CryptoSession::GetOkpFallbackPolicy();
|
||||
if (!system_fallback_policy) {
|
||||
LOGW("No system fallback policy available");
|
||||
return;
|
||||
}
|
||||
system_fallback_policy->SetDefaultBackoffDurationRules();
|
||||
}
|
||||
|
||||
void CdmEngine::SetFastOtaKeyboxFallbackDurationRules() {
|
||||
OkpCheck();
|
||||
std::unique_lock<std::mutex> lock(okp_mutex_);
|
||||
auto* system_fallback_policy = CryptoSession::GetOkpFallbackPolicy();
|
||||
if (!system_fallback_policy) {
|
||||
LOGW("No system fallback policy available");
|
||||
return;
|
||||
}
|
||||
system_fallback_policy->SetFastBackoffDurationRules();
|
||||
}
|
||||
} // namespace wvcdm
|
||||
|
||||
@@ -188,6 +188,9 @@ class WvContentDecryptionModule : public android::RefBase, public TimerHandler {
|
||||
virtual CdmResponseType GetSessionUserId(const CdmSessionId& session_id,
|
||||
uint32_t* user_id);
|
||||
|
||||
virtual bool SetDefaultOtaKeyboxFallbackDurationRules();
|
||||
virtual bool SetFastOtaKeyboxFallbackDurationRules();
|
||||
|
||||
private:
|
||||
struct CdmInfo {
|
||||
CdmInfo();
|
||||
|
||||
@@ -645,4 +645,19 @@ CdmResponseType WvContentDecryptionModule::GetSessionUserId(
|
||||
*user_id = cdm_engine->GetUserId();
|
||||
return NO_ERROR;
|
||||
}
|
||||
|
||||
bool WvContentDecryptionModule::SetDefaultOtaKeyboxFallbackDurationRules() {
|
||||
CdmEngine* cdm_engine = EnsureCdmForIdentifier(kDefaultCdmIdentifier);
|
||||
if (!cdm_engine) return false;
|
||||
cdm_engine->SetDefaultOtaKeyboxFallbackDurationRules();
|
||||
return true;
|
||||
}
|
||||
|
||||
bool WvContentDecryptionModule::SetFastOtaKeyboxFallbackDurationRules() {
|
||||
CdmEngine* cdm_engine = EnsureCdmForIdentifier(kDefaultCdmIdentifier);
|
||||
if (!cdm_engine) return false;
|
||||
cdm_engine->SetFastOtaKeyboxFallbackDurationRules();
|
||||
return true;
|
||||
}
|
||||
|
||||
} // namespace wvcdm
|
||||
|
||||
Reference in New Issue
Block a user