Add "Model Year" to list of CDM identification properties
(This is a merge of http://go/wvgerrit/138969.) Provisioning 4.0 on CE CDM requires not only the make & model but the model year in order to relate a device back to its system ID. This patch adds model year to the list of properties that partners must provide as client identification. As no equivalent field exists for Android, this property is not provided on Android platforms. Bug: 206453352 Test: x86-64 Change-Id: I0764d67fec54fa9a0c65074e68f3ee02de1e7820
This commit is contained in:
@@ -66,6 +66,7 @@ class Properties {
|
||||
}
|
||||
static bool GetCompanyName(std::string* company_name);
|
||||
static bool GetModelName(std::string* model_name);
|
||||
static bool GetModelYear(std::string* model_year);
|
||||
static bool GetArchitectureName(std::string* arch_name);
|
||||
static bool GetDeviceName(std::string* device_name);
|
||||
static bool GetProductName(std::string* product_name);
|
||||
|
||||
@@ -17,6 +17,7 @@ namespace wvcdm {
|
||||
namespace {
|
||||
const std::string kKeyCompanyName = "company_name";
|
||||
const std::string kKeyModelName = "model_name";
|
||||
const std::string kKeyModelYear = "model_year";
|
||||
const std::string kKeyArchitectureName = "architecture_name";
|
||||
const std::string kKeyDeviceName = "device_name";
|
||||
const std::string kKeyProductName = "product_name";
|
||||
@@ -29,9 +30,10 @@ const std::string kKeyOemCryptoBuildInformation =
|
||||
|
||||
// These client identification keys are used by the CDM for relaying
|
||||
// important device information that cannot be overwritten by the app.
|
||||
const std::array<std::string, 9> kReservedProperties = {
|
||||
const std::array<std::string, 10> kReservedProperties = {
|
||||
kKeyCompanyName,
|
||||
kKeyModelName,
|
||||
kKeyModelYear,
|
||||
kKeyArchitectureName,
|
||||
kKeyDeviceName,
|
||||
kKeyProductName,
|
||||
@@ -159,6 +161,11 @@ CdmResponseType ClientIdentification::Prepare(
|
||||
client_info->set_name(kKeyModelName);
|
||||
client_info->set_value(value);
|
||||
}
|
||||
if (Properties::GetModelYear(&value)) {
|
||||
client_info = client_id->add_client_info();
|
||||
client_info->set_name(kKeyModelYear);
|
||||
client_info->set_value(value);
|
||||
}
|
||||
if (Properties::GetArchitectureName(&value)) {
|
||||
client_info = client_id->add_client_info();
|
||||
client_info->set_name(kKeyArchitectureName);
|
||||
|
||||
@@ -71,6 +71,10 @@ bool Properties::GetModelName(std::string* model_name) {
|
||||
return GetAndroidProperty("ro.product.model", model_name);
|
||||
}
|
||||
|
||||
bool Properties::GetModelYear(std::string* /*model_year*/) {
|
||||
return false; // Not implemented on Android
|
||||
}
|
||||
|
||||
bool Properties::GetArchitectureName(std::string* arch_name) {
|
||||
if (!arch_name) {
|
||||
LOGW("Properties::GetArchitectureName: Invalid parameter");
|
||||
|
||||
Reference in New Issue
Block a user