diff --git a/libwvdrmengine/cdm/core/include/properties.h b/libwvdrmengine/cdm/core/include/properties.h index 34eeaa32..72b8e376 100644 --- a/libwvdrmengine/cdm/core/include/properties.h +++ b/libwvdrmengine/cdm/core/include/properties.h @@ -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); diff --git a/libwvdrmengine/cdm/core/src/client_identification.cpp b/libwvdrmengine/cdm/core/src/client_identification.cpp index 2b068e6a..3a997995 100644 --- a/libwvdrmengine/cdm/core/src/client_identification.cpp +++ b/libwvdrmengine/cdm/core/src/client_identification.cpp @@ -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 kReservedProperties = { +const std::array 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); diff --git a/libwvdrmengine/cdm/src/properties_android.cpp b/libwvdrmengine/cdm/src/properties_android.cpp index 36d5dec4..2fa4839f 100644 --- a/libwvdrmengine/cdm/src/properties_android.cpp +++ b/libwvdrmengine/cdm/src/properties_android.cpp @@ -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");