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
47 lines
1.1 KiB
C++
47 lines
1.1 KiB
C++
// Copyright 2013 Google Inc. All Rights Reserved.
|
|
|
|
#include <string>
|
|
|
|
#include "cutils/properties.h"
|
|
#include "properties.h"
|
|
|
|
namespace {
|
|
bool GetAndroidProperty(const char* key, std::string& value) {
|
|
char val[PROPERTY_VALUE_MAX];
|
|
|
|
if (property_get(key, val, "Unknown") <= 0)
|
|
return false;
|
|
|
|
value = val;
|
|
return true;
|
|
}
|
|
}
|
|
|
|
namespace wvcdm {
|
|
|
|
bool Properties::GetCompanyName(std::string& company_name) {
|
|
return GetAndroidProperty("ro.product.manufacturer", company_name);
|
|
}
|
|
|
|
bool Properties::GetModelName(std::string& model_name) {
|
|
return GetAndroidProperty("ro.product.model", model_name);
|
|
}
|
|
|
|
bool Properties::GetArchitectureName(std::string& arch_name) {
|
|
return GetAndroidProperty("ro.product.cpu.abi", arch_name);
|
|
}
|
|
|
|
bool Properties::GetDeviceName(std::string& device_name) {
|
|
return GetAndroidProperty("ro.product.device", device_name);
|
|
}
|
|
|
|
bool Properties::GetProductName(std::string& product_name) {
|
|
return GetAndroidProperty("ro.product.name", product_name);
|
|
}
|
|
|
|
bool Properties::GetBuildInfo(std::string& build_info) {
|
|
return GetAndroidProperty("ro.build.fingerprint", build_info);
|
|
}
|
|
|
|
} // namespace wvcdm
|