Add OS Version to Properties
(This is a merge of http://go/wvgerrit/11613 from the Widevine CDM repo.) Adds a property for the OS version, implements it on Android, and adds it to the license request property bag so that Netflix may use it to discern the supported capabilities of the CDM. Bug: 18230738 Change-Id: If5174a108093855314f3e0102b83691e20bb247b
This commit is contained in:
@@ -48,6 +48,7 @@ class Properties {
|
||||
static bool GetDeviceName(std::string* device_name);
|
||||
static bool GetProductName(std::string* product_name);
|
||||
static bool GetBuildInfo(std::string* build_info);
|
||||
static bool GetOsVersion(std::string* os_version);
|
||||
static bool GetDeviceFilesBasePath(CdmSecurityLevel security_level,
|
||||
std::string* base_path);
|
||||
static bool GetFactoryKeyboxPath(std::string* keybox);
|
||||
|
||||
@@ -25,6 +25,7 @@ std::string kDeviceNameKey = "device_name";
|
||||
std::string kProductNameKey = "product_name";
|
||||
std::string kBuildInfoKey = "build_info";
|
||||
std::string kDeviceIdKey = "device_id";
|
||||
std::string kOsVersion = "os_version";
|
||||
const unsigned char kServiceCertificateCAPublicKey[] = {
|
||||
0x30, 0x82, 0x01, 0x8a, 0x02, 0x82, 0x01, 0x81,
|
||||
0x00, 0xb4, 0xfe, 0x39, 0xc3, 0x65, 0x90, 0x03,
|
||||
@@ -281,6 +282,11 @@ bool CdmLicense::PrepareKeyRequest(const InitializationData& init_data,
|
||||
client_info->set_name(kDeviceIdKey);
|
||||
client_info->set_value(value);
|
||||
}
|
||||
if (Properties::GetOSVersion(&value)) {
|
||||
client_info = client_id->add_client_info();
|
||||
client_info->set_name(kOsVersionKey);
|
||||
client_info->set_value(value);
|
||||
}
|
||||
|
||||
ClientIdentification_ClientCapabilities* client_capabilities =
|
||||
client_id->mutable_client_capabilities();
|
||||
|
||||
@@ -87,6 +87,14 @@ bool Properties::GetBuildInfo(std::string* build_info) {
|
||||
return GetAndroidProperty("ro.build.fingerprint", build_info);
|
||||
}
|
||||
|
||||
bool Properties::GetOsVersion(std::string* os_version) {
|
||||
if (!os_version) {
|
||||
LOGW("Properties::GetOsVersion: Invalid parameter");
|
||||
return false;
|
||||
}
|
||||
return GetAndroidProperty("ro.build.version.release", os_version);
|
||||
}
|
||||
|
||||
bool Properties::GetDeviceFilesBasePath(CdmSecurityLevel security_level,
|
||||
std::string* base_path) {
|
||||
if (!base_path) {
|
||||
|
||||
Reference in New Issue
Block a user