Send spoids in provisioning requests

[ Merge of http://go/wvgerrit/87283 ]

SPOIDs (Stable Per-Origin IDentifiers) were not correctly being
set during CdmEngine construction. This resulted in SPOID values not
being sent in provisioning requests. This caused the serial number in
the drm certificate to not be stable after a reprovision.
This behaviour appears to be true going back to O.

CdmEngine no longer takes a SPOID in the constructor since not all
callers use SPOIDs. A setter has been added in its place. Previously
spoid had a default argument to the constructor.

Bug: 142368328
Test: android unit/integration tests
Change-Id: I711346df609636ecf1475dc37873454a7ef000c0
This commit is contained in:
Rahul Frias
2019-10-16 16:53:11 -07:00
parent 2e22e2321e
commit af15f8c83d
6 changed files with 113 additions and 19 deletions

View File

@@ -343,6 +343,7 @@ class CdmEngine {
app_package_name_ = app_package_name;
}
virtual const std::string& GetAppPackageName() { return app_package_name_; }
virtual void SetSpoid(const std::string& spoid) { spoid_ = spoid; }
protected:
friend class CdmEngineFactory;
@@ -353,8 +354,7 @@ class CdmEngine {
friend class TestLicenseHolder;
CdmEngine(FileSystem* file_system,
std::shared_ptr<metrics::EngineMetrics> metrics,
const std::string& spoid = EMPTY_SPOID);
std::shared_ptr<metrics::EngineMetrics> metrics);
private:
// private methods

View File

@@ -48,9 +48,8 @@ class CdmEngineMetricsImpl : public T {
// |metrics| is used within the base class constructor. So, it must be
// passed in as a dependency and provided to the base constructor.
CdmEngineMetricsImpl(FileSystem* file_system,
std::shared_ptr<metrics::EngineMetrics> metrics,
const std::string& spoid = EMPTY_SPOID)
: T(file_system, metrics, spoid), metrics_(metrics) {
std::shared_ptr<metrics::EngineMetrics> metrics)
: T(file_system, metrics), metrics_(metrics) {
metrics_->cdm_engine_creation_time_millis_.Record(clock_.GetCurrentTime());
std::string cdm_version;
if (Properties::GetWVCdmVersion(&cdm_version)) {