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
81 lines
2.5 KiB
C++
81 lines
2.5 KiB
C++
// Copyright 2013 Google Inc. All Rights Reserved.
|
|
|
|
#ifndef CDM_BASE_PROPERTIES_H_
|
|
#define CDM_BASE_PROPERTIES_H_
|
|
|
|
#include <map>
|
|
#include <string>
|
|
|
|
#include "lock.h"
|
|
#include "wv_cdm_types.h"
|
|
|
|
namespace wvcdm {
|
|
|
|
// This class saves information about features and properties enabled
|
|
// for a given platform. At initialization it initializes properties from
|
|
// property_configuration.h. That file specifies features selected for each
|
|
// platform. Core CDM can then query enabled features though specific getter
|
|
// methods.
|
|
// Setter methods are provided but their only planned use is for testing.
|
|
class Properties {
|
|
public:
|
|
static void Init();
|
|
|
|
static inline bool begin_license_usage_when_received() {
|
|
return begin_license_usage_when_received_;
|
|
}
|
|
static inline bool require_explicit_renew_request() {
|
|
return require_explicit_renew_request_;
|
|
}
|
|
static inline bool oem_crypto_use_secure_buffers() {
|
|
return oem_crypto_use_secure_buffers_;
|
|
}
|
|
static inline bool oem_crypto_use_fifo() {
|
|
return oem_crypto_use_fifo_;
|
|
}
|
|
static inline bool oem_crypto_use_userspace_buffers() {
|
|
return oem_crypto_use_userspace_buffers_;
|
|
}
|
|
static inline bool use_certificates_as_identification() {
|
|
return use_certificates_as_identification_;
|
|
}
|
|
static bool GetModelName(std::string& model_name);
|
|
static bool GetArchitectureName(std::string& arch_name);
|
|
static bool GetDeviceName(std::string& device_name);
|
|
static bool GetProductName(std::string& product_name);
|
|
static bool GetBuildInfo(std::string& build_info);
|
|
|
|
private:
|
|
static void set_begin_license_usage_when_received(bool flag) {
|
|
begin_license_usage_when_received_ = flag;
|
|
}
|
|
static void set_require_explicit_renew_request(bool flag) {
|
|
require_explicit_renew_request_ = flag;
|
|
}
|
|
static void set_oem_crypto_use_secure_buffers(bool flag) {
|
|
oem_crypto_use_secure_buffers_ = flag;
|
|
}
|
|
static void set_oem_crypto_use_fifo(bool flag) {
|
|
oem_crypto_use_fifo_ = flag;
|
|
}
|
|
static void set_oem_crypto_use_userspace_buffers(bool flag) {
|
|
oem_crypto_use_userspace_buffers_ = flag;
|
|
}
|
|
static void set_use_certificates_as_identification(bool flag) {
|
|
use_certificates_as_identification_ = flag;
|
|
}
|
|
|
|
static bool begin_license_usage_when_received_;
|
|
static bool require_explicit_renew_request_;
|
|
static bool oem_crypto_use_secure_buffers_;
|
|
static bool oem_crypto_use_fifo_;
|
|
static bool oem_crypto_use_userspace_buffers_;
|
|
static bool use_certificates_as_identification_;
|
|
|
|
CORE_DISALLOW_COPY_AND_ASSIGN(Properties);
|
|
};
|
|
|
|
} // namespace wvcdm
|
|
|
|
#endif // CDM_BASE_PROPERTIES_H_
|