Add property to check if user forces L3
[ Merge of go/wvgerrit/186611 ] Android user can set the property using the developer option. Bug: 301669353 Change-Id: I730b635f6cc28dfb0471c1d679627c94b9e16af1
This commit is contained in:
@@ -82,6 +82,8 @@ class Properties {
|
||||
static bool GetSandboxId(std::string* sandbox_id);
|
||||
static bool AlwaysUseKeySetIds();
|
||||
static bool UseProviderIdInProvisioningRequest();
|
||||
// Cdm only loads L3 library when this returns true
|
||||
static bool ForceL3();
|
||||
|
||||
static bool GetSecurityLevelDirectories(std::vector<std::string>* dirs);
|
||||
static bool GetApplicationId(const CdmSessionId& session_id,
|
||||
|
||||
@@ -794,6 +794,7 @@ class Adapter {
|
||||
wvcdm::metrics::OEMCrypto_INITIALIZED_FORCING_L3);
|
||||
return result;
|
||||
}
|
||||
|
||||
LOGI("L3 Initialized. Trying L1.");
|
||||
std::vector<std::string> library_names;
|
||||
if (!wvcdm::Properties::GetOEMCryptoPaths(&library_names)) {
|
||||
@@ -1376,9 +1377,15 @@ class Adapter {
|
||||
std::mutex session_map_lock_;
|
||||
std::vector<uint8_t> sandbox_id_;
|
||||
|
||||
// For running the unit tests using the level 3 oemcrypto. If the user sets
|
||||
// the environment FORCE_LEVEL3_OEMCRYPTO, we ignore the level 1 library.
|
||||
// First check if user sets force L3 property to be true. Then
|
||||
// check if the user sets the environment FORCE_LEVEL3_OEMCRYPTO
|
||||
// for running the unit tests using the level 3 oemcrypto.
|
||||
// If any of above is true, we ignore the level 1 library.
|
||||
bool force_level3() {
|
||||
if (wvcdm::Properties::ForceL3()) {
|
||||
LOGW("User requested falling back to L3");
|
||||
return true;
|
||||
}
|
||||
const char* var = getenv("FORCE_LEVEL3_OEMCRYPTO");
|
||||
if (!var) return false;
|
||||
return !strcmp(var, "yes");
|
||||
|
||||
Reference in New Issue
Block a user