License property for company_name should come from device on android

The company_name was hardcoded in the CDM as "Google" for all devices.
On Android, it needs to come from the ro.product.manufacturer system
property.

bug: 9074091

This is a merge of https://widevine-internal-review.googlesource.com/#/c/5730/
from the Widevine CDM repository.

Change-Id: Ia3ae82abf350c32ba8b4d05b59e95361927dea40
This commit is contained in:
Jeff Tinker
2013-05-21 15:20:58 -07:00
parent 32d61899a2
commit 418f4b0e60
3 changed files with 10 additions and 4 deletions

View File

@@ -39,6 +39,7 @@ class Properties {
static inline bool use_certificates_as_identification() { static inline bool use_certificates_as_identification() {
return use_certificates_as_identification_; return use_certificates_as_identification_;
} }
static bool GetCompanyName(std::string& company_name);
static bool GetModelName(std::string& model_name); static bool GetModelName(std::string& model_name);
static bool GetArchitectureName(std::string& arch_name); static bool GetArchitectureName(std::string& arch_name);
static bool GetDeviceName(std::string& device_name); static bool GetDeviceName(std::string& device_name);

View File

@@ -14,7 +14,6 @@
namespace { namespace {
std::string kCompanyNameKey = "company_name"; std::string kCompanyNameKey = "company_name";
std::string kCompanyNameValueGoogle = "Google";
std::string kModelNameKey = "model_name"; std::string kModelNameKey = "model_name";
std::string kArchitectureNameKey = "architecture_name"; std::string kArchitectureNameKey = "architecture_name";
std::string kDeviceNameKey = "device_name"; std::string kDeviceNameKey = "device_name";
@@ -136,9 +135,11 @@ bool CdmLicense::PrepareKeyRequest(const CdmInitData& init_data,
client_info->set_value(iter->second); client_info->set_value(iter->second);
} }
std::string value; std::string value;
client_info = client_id->add_client_info(); if (Properties::GetCompanyName(value)) {
client_info->set_name(kCompanyNameKey); client_info = client_id->add_client_info();
client_info->set_value(kCompanyNameValueGoogle); client_info->set_name(kCompanyNameKey);
client_info->set_value(value);
}
if (Properties::GetModelName(value)) { if (Properties::GetModelName(value)) {
client_info = client_id->add_client_info(); client_info = client_id->add_client_info();
client_info->set_name(kModelNameKey); client_info->set_name(kModelNameKey);

View File

@@ -19,6 +19,10 @@ namespace {
namespace wvcdm { namespace wvcdm {
bool Properties::GetCompanyName(std::string& company_name) {
return GetAndroidProperty("ro.product.manufacturer", company_name);
}
bool Properties::GetModelName(std::string& model_name) { bool Properties::GetModelName(std::string& model_name) {
return GetAndroidProperty("ro.product.model", model_name); return GetAndroidProperty("ro.product.model", model_name);
} }