Add device ID to Widevine license request
Also added other Client identification fields specified in license exchange protocol, Appendix C https://docs.google.com/a/google.com/document/d/1cng6cDnchbDQDymLEd5MxMc_laS3EDv6IsoW3IzpgwQ/edit#heading=h.pmkiti873xeg They are company, model, architecture, device and product name. bug: 8292249 Change-Id: I4d5fa93a0c85c7abb025c66d48e4aafbfe90efd8
This commit is contained in:
42
libwvdrmengine/cdm/src/properties.cpp
Normal file
42
libwvdrmengine/cdm/src/properties.cpp
Normal file
@@ -0,0 +1,42 @@
|
||||
// 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::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
|
||||
Reference in New Issue
Block a user